Data.Colour.RGBSpace.HSL:hsl from colour-2.3.3, E

Percentage Accurate: 99.7% → 99.8%
Time: 2.6s
Alternatives: 12
Speedup: 1.1×

Specification

?
\[\begin{array}{l} \\ x + \left(\left(y - x\right) \cdot 6\right) \cdot z \end{array} \]
(FPCore (x y z) :precision binary64 (+ x (* (* (- y x) 6.0) z)))
double code(double x, double y, double z) {
	return x + (((y - x) * 6.0) * z);
}
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)
use fmin_fmax_functions
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    code = x + (((y - x) * 6.0d0) * z)
end function
public static double code(double x, double y, double z) {
	return x + (((y - x) * 6.0) * z);
}
def code(x, y, z):
	return x + (((y - x) * 6.0) * z)
function code(x, y, z)
	return Float64(x + Float64(Float64(Float64(y - x) * 6.0) * z))
end
function tmp = code(x, y, z)
	tmp = x + (((y - x) * 6.0) * z);
end
code[x_, y_, z_] := N[(x + N[(N[(N[(y - x), $MachinePrecision] * 6.0), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
x + \left(\left(y - x\right) \cdot 6\right) \cdot z
\end{array}

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 12 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: 99.7% accurate, 1.0× speedup?

\[\begin{array}{l} \\ x + \left(\left(y - x\right) \cdot 6\right) \cdot z \end{array} \]
(FPCore (x y z) :precision binary64 (+ x (* (* (- y x) 6.0) z)))
double code(double x, double y, double z) {
	return x + (((y - x) * 6.0) * z);
}
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)
use fmin_fmax_functions
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    code = x + (((y - x) * 6.0d0) * z)
end function
public static double code(double x, double y, double z) {
	return x + (((y - x) * 6.0) * z);
}
def code(x, y, z):
	return x + (((y - x) * 6.0) * z)
function code(x, y, z)
	return Float64(x + Float64(Float64(Float64(y - x) * 6.0) * z))
end
function tmp = code(x, y, z)
	tmp = x + (((y - x) * 6.0) * z);
end
code[x_, y_, z_] := N[(x + N[(N[(N[(y - x), $MachinePrecision] * 6.0), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
x + \left(\left(y - x\right) \cdot 6\right) \cdot z
\end{array}

Alternative 1: 99.8% accurate, 1.1× speedup?

\[\begin{array}{l} \\ \mathsf{fma}\left(\left(x - y\right) \cdot z, -6, x\right) \end{array} \]
(FPCore (x y z) :precision binary64 (fma (* (- x y) z) -6.0 x))
double code(double x, double y, double z) {
	return fma(((x - y) * z), -6.0, x);
}
function code(x, y, z)
	return fma(Float64(Float64(x - y) * z), -6.0, x)
end
code[x_, y_, z_] := N[(N[(N[(x - y), $MachinePrecision] * z), $MachinePrecision] * -6.0 + x), $MachinePrecision]
\begin{array}{l}

\\
\mathsf{fma}\left(\left(x - y\right) \cdot z, -6, x\right)
\end{array}
Derivation
  1. Initial program 99.7%

    \[x + \left(\left(y - x\right) \cdot 6\right) \cdot z \]
  2. Step-by-step derivation
    1. lift-+.f64N/A

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

      \[\leadsto \color{blue}{\left(\left(y - x\right) \cdot 6\right) \cdot z + x} \]
    3. add-flipN/A

      \[\leadsto \color{blue}{\left(\left(y - x\right) \cdot 6\right) \cdot z - \left(\mathsf{neg}\left(x\right)\right)} \]
    4. *-lft-identityN/A

      \[\leadsto \left(\left(y - x\right) \cdot 6\right) \cdot z - \color{blue}{1 \cdot \left(\mathsf{neg}\left(x\right)\right)} \]
    5. fp-cancel-sub-sign-invN/A

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

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

      \[\leadsto \color{blue}{\left(\left(y - x\right) \cdot 6\right)} \cdot z + \left(\mathsf{neg}\left(1\right)\right) \cdot \left(\mathsf{neg}\left(x\right)\right) \]
    8. associate-*l*N/A

      \[\leadsto \color{blue}{\left(y - x\right) \cdot \left(6 \cdot z\right)} + \left(\mathsf{neg}\left(1\right)\right) \cdot \left(\mathsf{neg}\left(x\right)\right) \]
    9. *-commutativeN/A

      \[\leadsto \left(y - x\right) \cdot \color{blue}{\left(z \cdot 6\right)} + \left(\mathsf{neg}\left(1\right)\right) \cdot \left(\mathsf{neg}\left(x\right)\right) \]
    10. associate-*r*N/A

      \[\leadsto \color{blue}{\left(\left(y - x\right) \cdot z\right) \cdot 6} + \left(\mathsf{neg}\left(1\right)\right) \cdot \left(\mathsf{neg}\left(x\right)\right) \]
    11. *-commutativeN/A

      \[\leadsto \color{blue}{\left(z \cdot \left(y - x\right)\right)} \cdot 6 + \left(\mathsf{neg}\left(1\right)\right) \cdot \left(\mathsf{neg}\left(x\right)\right) \]
    12. remove-double-negN/A

      \[\leadsto \left(z \cdot \left(y - x\right)\right) \cdot \color{blue}{\left(\mathsf{neg}\left(\left(\mathsf{neg}\left(6\right)\right)\right)\right)} + \left(\mathsf{neg}\left(1\right)\right) \cdot \left(\mathsf{neg}\left(x\right)\right) \]
    13. distribute-rgt-neg-outN/A

      \[\leadsto \color{blue}{\left(\mathsf{neg}\left(\left(z \cdot \left(y - x\right)\right) \cdot \left(\mathsf{neg}\left(6\right)\right)\right)\right)} + \left(\mathsf{neg}\left(1\right)\right) \cdot \left(\mathsf{neg}\left(x\right)\right) \]
    14. distribute-lft-neg-inN/A

      \[\leadsto \color{blue}{\left(\mathsf{neg}\left(z \cdot \left(y - x\right)\right)\right) \cdot \left(\mathsf{neg}\left(6\right)\right)} + \left(\mathsf{neg}\left(1\right)\right) \cdot \left(\mathsf{neg}\left(x\right)\right) \]
    15. distribute-lft-neg-outN/A

      \[\leadsto \left(\mathsf{neg}\left(z \cdot \left(y - x\right)\right)\right) \cdot \left(\mathsf{neg}\left(6\right)\right) + \color{blue}{\left(\mathsf{neg}\left(1 \cdot \left(\mathsf{neg}\left(x\right)\right)\right)\right)} \]
    16. *-lft-identityN/A

      \[\leadsto \left(\mathsf{neg}\left(z \cdot \left(y - x\right)\right)\right) \cdot \left(\mathsf{neg}\left(6\right)\right) + \left(\mathsf{neg}\left(\color{blue}{\left(\mathsf{neg}\left(x\right)\right)}\right)\right) \]
    17. remove-double-negN/A

      \[\leadsto \left(\mathsf{neg}\left(z \cdot \left(y - x\right)\right)\right) \cdot \left(\mathsf{neg}\left(6\right)\right) + \color{blue}{x} \]
    18. lower-fma.f64N/A

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

      \[\leadsto \mathsf{fma}\left(\mathsf{neg}\left(\color{blue}{\left(y - x\right) \cdot z}\right), \mathsf{neg}\left(6\right), x\right) \]
    20. distribute-lft-neg-outN/A

      \[\leadsto \mathsf{fma}\left(\color{blue}{\left(\mathsf{neg}\left(\left(y - x\right)\right)\right) \cdot z}, \mathsf{neg}\left(6\right), x\right) \]
    21. lift--.f64N/A

      \[\leadsto \mathsf{fma}\left(\left(\mathsf{neg}\left(\color{blue}{\left(y - x\right)}\right)\right) \cdot z, \mathsf{neg}\left(6\right), x\right) \]
    22. sub-negate-revN/A

      \[\leadsto \mathsf{fma}\left(\color{blue}{\left(x - y\right)} \cdot z, \mathsf{neg}\left(6\right), x\right) \]
    23. lower-*.f64N/A

      \[\leadsto \mathsf{fma}\left(\color{blue}{\left(x - y\right) \cdot z}, \mathsf{neg}\left(6\right), x\right) \]
    24. lower--.f64N/A

      \[\leadsto \mathsf{fma}\left(\color{blue}{\left(x - y\right)} \cdot z, \mathsf{neg}\left(6\right), x\right) \]
    25. metadata-eval99.8

      \[\leadsto \mathsf{fma}\left(\left(x - y\right) \cdot z, \color{blue}{-6}, x\right) \]
  3. Applied rewrites99.8%

    \[\leadsto \color{blue}{\mathsf{fma}\left(\left(x - y\right) \cdot z, -6, x\right)} \]
  4. Add Preprocessing

Alternative 2: 98.6% accurate, 0.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -0.165:\\
\;\;\;\;\left(y - x\right) \cdot \left(z \cdot 6\right)\\

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

\mathbf{else}:\\
\;\;\;\;-6 \cdot \left(z \cdot \left(x - y\right)\right)\\


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

    1. Initial program 99.7%

      \[x + \left(\left(y - x\right) \cdot 6\right) \cdot z \]
    2. Step-by-step derivation
      1. lift-+.f64N/A

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

        \[\leadsto \color{blue}{\left(\left(y - x\right) \cdot 6\right) \cdot z + x} \]
      3. add-flipN/A

        \[\leadsto \color{blue}{\left(\left(y - x\right) \cdot 6\right) \cdot z - \left(\mathsf{neg}\left(x\right)\right)} \]
      4. *-lft-identityN/A

        \[\leadsto \left(\left(y - x\right) \cdot 6\right) \cdot z - \color{blue}{1 \cdot \left(\mathsf{neg}\left(x\right)\right)} \]
      5. fp-cancel-sub-sign-invN/A

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

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

        \[\leadsto \color{blue}{\left(\left(y - x\right) \cdot 6\right)} \cdot z + \left(\mathsf{neg}\left(1\right)\right) \cdot \left(\mathsf{neg}\left(x\right)\right) \]
      8. associate-*l*N/A

        \[\leadsto \color{blue}{\left(y - x\right) \cdot \left(6 \cdot z\right)} + \left(\mathsf{neg}\left(1\right)\right) \cdot \left(\mathsf{neg}\left(x\right)\right) \]
      9. *-commutativeN/A

        \[\leadsto \left(y - x\right) \cdot \color{blue}{\left(z \cdot 6\right)} + \left(\mathsf{neg}\left(1\right)\right) \cdot \left(\mathsf{neg}\left(x\right)\right) \]
      10. associate-*r*N/A

        \[\leadsto \color{blue}{\left(\left(y - x\right) \cdot z\right) \cdot 6} + \left(\mathsf{neg}\left(1\right)\right) \cdot \left(\mathsf{neg}\left(x\right)\right) \]
      11. *-commutativeN/A

        \[\leadsto \color{blue}{\left(z \cdot \left(y - x\right)\right)} \cdot 6 + \left(\mathsf{neg}\left(1\right)\right) \cdot \left(\mathsf{neg}\left(x\right)\right) \]
      12. remove-double-negN/A

        \[\leadsto \left(z \cdot \left(y - x\right)\right) \cdot \color{blue}{\left(\mathsf{neg}\left(\left(\mathsf{neg}\left(6\right)\right)\right)\right)} + \left(\mathsf{neg}\left(1\right)\right) \cdot \left(\mathsf{neg}\left(x\right)\right) \]
      13. distribute-rgt-neg-outN/A

        \[\leadsto \color{blue}{\left(\mathsf{neg}\left(\left(z \cdot \left(y - x\right)\right) \cdot \left(\mathsf{neg}\left(6\right)\right)\right)\right)} + \left(\mathsf{neg}\left(1\right)\right) \cdot \left(\mathsf{neg}\left(x\right)\right) \]
      14. distribute-lft-neg-inN/A

        \[\leadsto \color{blue}{\left(\mathsf{neg}\left(z \cdot \left(y - x\right)\right)\right) \cdot \left(\mathsf{neg}\left(6\right)\right)} + \left(\mathsf{neg}\left(1\right)\right) \cdot \left(\mathsf{neg}\left(x\right)\right) \]
      15. distribute-lft-neg-outN/A

        \[\leadsto \left(\mathsf{neg}\left(z \cdot \left(y - x\right)\right)\right) \cdot \left(\mathsf{neg}\left(6\right)\right) + \color{blue}{\left(\mathsf{neg}\left(1 \cdot \left(\mathsf{neg}\left(x\right)\right)\right)\right)} \]
      16. *-lft-identityN/A

        \[\leadsto \left(\mathsf{neg}\left(z \cdot \left(y - x\right)\right)\right) \cdot \left(\mathsf{neg}\left(6\right)\right) + \left(\mathsf{neg}\left(\color{blue}{\left(\mathsf{neg}\left(x\right)\right)}\right)\right) \]
      17. remove-double-negN/A

        \[\leadsto \left(\mathsf{neg}\left(z \cdot \left(y - x\right)\right)\right) \cdot \left(\mathsf{neg}\left(6\right)\right) + \color{blue}{x} \]
      18. lower-fma.f64N/A

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

        \[\leadsto \mathsf{fma}\left(\mathsf{neg}\left(\color{blue}{\left(y - x\right) \cdot z}\right), \mathsf{neg}\left(6\right), x\right) \]
      20. distribute-lft-neg-outN/A

        \[\leadsto \mathsf{fma}\left(\color{blue}{\left(\mathsf{neg}\left(\left(y - x\right)\right)\right) \cdot z}, \mathsf{neg}\left(6\right), x\right) \]
      21. lift--.f64N/A

        \[\leadsto \mathsf{fma}\left(\left(\mathsf{neg}\left(\color{blue}{\left(y - x\right)}\right)\right) \cdot z, \mathsf{neg}\left(6\right), x\right) \]
      22. sub-negate-revN/A

        \[\leadsto \mathsf{fma}\left(\color{blue}{\left(x - y\right)} \cdot z, \mathsf{neg}\left(6\right), x\right) \]
      23. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(\color{blue}{\left(x - y\right) \cdot z}, \mathsf{neg}\left(6\right), x\right) \]
      24. lower--.f64N/A

        \[\leadsto \mathsf{fma}\left(\color{blue}{\left(x - y\right)} \cdot z, \mathsf{neg}\left(6\right), x\right) \]
      25. metadata-eval99.8

        \[\leadsto \mathsf{fma}\left(\left(x - y\right) \cdot z, \color{blue}{-6}, x\right) \]
    3. Applied rewrites99.8%

      \[\leadsto \color{blue}{\mathsf{fma}\left(\left(x - y\right) \cdot z, -6, x\right)} \]
    4. Taylor expanded in z around inf

      \[\leadsto \color{blue}{-6 \cdot \left(z \cdot \left(x - y\right)\right)} \]
    5. Step-by-step derivation
      1. lower-*.f64N/A

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

        \[\leadsto -6 \cdot \left(z \cdot \color{blue}{\left(x - y\right)}\right) \]
      3. lower--.f6466.0

        \[\leadsto -6 \cdot \left(z \cdot \left(x - \color{blue}{y}\right)\right) \]
    6. Applied rewrites66.0%

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

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

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

        \[\leadsto \left(z \cdot \left(x - y\right)\right) \cdot -6 \]
      4. *-commutativeN/A

        \[\leadsto \left(\left(x - y\right) \cdot z\right) \cdot -6 \]
      5. lift--.f64N/A

        \[\leadsto \left(\left(x - y\right) \cdot z\right) \cdot -6 \]
      6. sub-negate-revN/A

        \[\leadsto \left(\left(\mathsf{neg}\left(\left(y - x\right)\right)\right) \cdot z\right) \cdot -6 \]
      7. distribute-lft-neg-outN/A

        \[\leadsto \left(\mathsf{neg}\left(\left(y - x\right) \cdot z\right)\right) \cdot -6 \]
      8. distribute-lft-neg-outN/A

        \[\leadsto \mathsf{neg}\left(\left(\left(y - x\right) \cdot z\right) \cdot -6\right) \]
      9. distribute-rgt-neg-outN/A

        \[\leadsto \left(\left(y - x\right) \cdot z\right) \cdot \color{blue}{\left(\mathsf{neg}\left(-6\right)\right)} \]
      10. metadata-evalN/A

        \[\leadsto \left(\left(y - x\right) \cdot z\right) \cdot 6 \]
      11. associate-*r*N/A

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

        \[\leadsto \left(y - x\right) \cdot \color{blue}{\left(z \cdot 6\right)} \]
      13. lower--.f64N/A

        \[\leadsto \left(y - x\right) \cdot \left(\color{blue}{z} \cdot 6\right) \]
      14. lower-*.f6466.0

        \[\leadsto \left(y - x\right) \cdot \left(z \cdot \color{blue}{6}\right) \]
    8. Applied rewrites66.0%

      \[\leadsto \left(y - x\right) \cdot \color{blue}{\left(z \cdot 6\right)} \]

    if -0.165000000000000008 < z < 3.14999999999999998e-10

    1. Initial program 99.7%

      \[x + \left(\left(y - x\right) \cdot 6\right) \cdot z \]
    2. Taylor expanded in x around 0

      \[\leadsto x + \left(\color{blue}{y} \cdot 6\right) \cdot z \]
    3. Step-by-step derivation
      1. Applied rewrites75.8%

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

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

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

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

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

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

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

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

          \[\leadsto \color{blue}{\mathsf{fma}\left(y \cdot z, 6, x\right)} \]
        9. lower-*.f6475.9

          \[\leadsto \mathsf{fma}\left(\color{blue}{y \cdot z}, 6, x\right) \]
      3. Applied rewrites75.9%

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

      if 3.14999999999999998e-10 < z

      1. Initial program 99.7%

        \[x + \left(\left(y - x\right) \cdot 6\right) \cdot z \]
      2. Step-by-step derivation
        1. lift-+.f64N/A

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

          \[\leadsto \color{blue}{\left(\left(y - x\right) \cdot 6\right) \cdot z + x} \]
        3. add-flipN/A

          \[\leadsto \color{blue}{\left(\left(y - x\right) \cdot 6\right) \cdot z - \left(\mathsf{neg}\left(x\right)\right)} \]
        4. *-lft-identityN/A

          \[\leadsto \left(\left(y - x\right) \cdot 6\right) \cdot z - \color{blue}{1 \cdot \left(\mathsf{neg}\left(x\right)\right)} \]
        5. fp-cancel-sub-sign-invN/A

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

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

          \[\leadsto \color{blue}{\left(\left(y - x\right) \cdot 6\right)} \cdot z + \left(\mathsf{neg}\left(1\right)\right) \cdot \left(\mathsf{neg}\left(x\right)\right) \]
        8. associate-*l*N/A

          \[\leadsto \color{blue}{\left(y - x\right) \cdot \left(6 \cdot z\right)} + \left(\mathsf{neg}\left(1\right)\right) \cdot \left(\mathsf{neg}\left(x\right)\right) \]
        9. *-commutativeN/A

          \[\leadsto \left(y - x\right) \cdot \color{blue}{\left(z \cdot 6\right)} + \left(\mathsf{neg}\left(1\right)\right) \cdot \left(\mathsf{neg}\left(x\right)\right) \]
        10. associate-*r*N/A

          \[\leadsto \color{blue}{\left(\left(y - x\right) \cdot z\right) \cdot 6} + \left(\mathsf{neg}\left(1\right)\right) \cdot \left(\mathsf{neg}\left(x\right)\right) \]
        11. *-commutativeN/A

          \[\leadsto \color{blue}{\left(z \cdot \left(y - x\right)\right)} \cdot 6 + \left(\mathsf{neg}\left(1\right)\right) \cdot \left(\mathsf{neg}\left(x\right)\right) \]
        12. remove-double-negN/A

          \[\leadsto \left(z \cdot \left(y - x\right)\right) \cdot \color{blue}{\left(\mathsf{neg}\left(\left(\mathsf{neg}\left(6\right)\right)\right)\right)} + \left(\mathsf{neg}\left(1\right)\right) \cdot \left(\mathsf{neg}\left(x\right)\right) \]
        13. distribute-rgt-neg-outN/A

          \[\leadsto \color{blue}{\left(\mathsf{neg}\left(\left(z \cdot \left(y - x\right)\right) \cdot \left(\mathsf{neg}\left(6\right)\right)\right)\right)} + \left(\mathsf{neg}\left(1\right)\right) \cdot \left(\mathsf{neg}\left(x\right)\right) \]
        14. distribute-lft-neg-inN/A

          \[\leadsto \color{blue}{\left(\mathsf{neg}\left(z \cdot \left(y - x\right)\right)\right) \cdot \left(\mathsf{neg}\left(6\right)\right)} + \left(\mathsf{neg}\left(1\right)\right) \cdot \left(\mathsf{neg}\left(x\right)\right) \]
        15. distribute-lft-neg-outN/A

          \[\leadsto \left(\mathsf{neg}\left(z \cdot \left(y - x\right)\right)\right) \cdot \left(\mathsf{neg}\left(6\right)\right) + \color{blue}{\left(\mathsf{neg}\left(1 \cdot \left(\mathsf{neg}\left(x\right)\right)\right)\right)} \]
        16. *-lft-identityN/A

          \[\leadsto \left(\mathsf{neg}\left(z \cdot \left(y - x\right)\right)\right) \cdot \left(\mathsf{neg}\left(6\right)\right) + \left(\mathsf{neg}\left(\color{blue}{\left(\mathsf{neg}\left(x\right)\right)}\right)\right) \]
        17. remove-double-negN/A

          \[\leadsto \left(\mathsf{neg}\left(z \cdot \left(y - x\right)\right)\right) \cdot \left(\mathsf{neg}\left(6\right)\right) + \color{blue}{x} \]
        18. lower-fma.f64N/A

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

          \[\leadsto \mathsf{fma}\left(\mathsf{neg}\left(\color{blue}{\left(y - x\right) \cdot z}\right), \mathsf{neg}\left(6\right), x\right) \]
        20. distribute-lft-neg-outN/A

          \[\leadsto \mathsf{fma}\left(\color{blue}{\left(\mathsf{neg}\left(\left(y - x\right)\right)\right) \cdot z}, \mathsf{neg}\left(6\right), x\right) \]
        21. lift--.f64N/A

          \[\leadsto \mathsf{fma}\left(\left(\mathsf{neg}\left(\color{blue}{\left(y - x\right)}\right)\right) \cdot z, \mathsf{neg}\left(6\right), x\right) \]
        22. sub-negate-revN/A

          \[\leadsto \mathsf{fma}\left(\color{blue}{\left(x - y\right)} \cdot z, \mathsf{neg}\left(6\right), x\right) \]
        23. lower-*.f64N/A

          \[\leadsto \mathsf{fma}\left(\color{blue}{\left(x - y\right) \cdot z}, \mathsf{neg}\left(6\right), x\right) \]
        24. lower--.f64N/A

          \[\leadsto \mathsf{fma}\left(\color{blue}{\left(x - y\right)} \cdot z, \mathsf{neg}\left(6\right), x\right) \]
        25. metadata-eval99.8

          \[\leadsto \mathsf{fma}\left(\left(x - y\right) \cdot z, \color{blue}{-6}, x\right) \]
      3. Applied rewrites99.8%

        \[\leadsto \color{blue}{\mathsf{fma}\left(\left(x - y\right) \cdot z, -6, x\right)} \]
      4. Taylor expanded in z around inf

        \[\leadsto \color{blue}{-6 \cdot \left(z \cdot \left(x - y\right)\right)} \]
      5. Step-by-step derivation
        1. lower-*.f64N/A

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

          \[\leadsto -6 \cdot \left(z \cdot \color{blue}{\left(x - y\right)}\right) \]
        3. lower--.f6466.0

          \[\leadsto -6 \cdot \left(z \cdot \left(x - \color{blue}{y}\right)\right) \]
      6. Applied rewrites66.0%

        \[\leadsto \color{blue}{-6 \cdot \left(z \cdot \left(x - y\right)\right)} \]
    4. Recombined 3 regimes into one program.
    5. Add Preprocessing

    Alternative 3: 98.6% accurate, 0.7× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -0.2:\\ \;\;\;\;\left(6 \cdot \left(y - x\right)\right) \cdot z\\ \mathbf{elif}\;z \leq 3.15 \cdot 10^{-10}:\\ \;\;\;\;\mathsf{fma}\left(y \cdot z, 6, x\right)\\ \mathbf{else}:\\ \;\;\;\;-6 \cdot \left(z \cdot \left(x - y\right)\right)\\ \end{array} \end{array} \]
    (FPCore (x y z)
     :precision binary64
     (if (<= z -0.2)
       (* (* 6.0 (- y x)) z)
       (if (<= z 3.15e-10) (fma (* y z) 6.0 x) (* -6.0 (* z (- x y))))))
    double code(double x, double y, double z) {
    	double tmp;
    	if (z <= -0.2) {
    		tmp = (6.0 * (y - x)) * z;
    	} else if (z <= 3.15e-10) {
    		tmp = fma((y * z), 6.0, x);
    	} else {
    		tmp = -6.0 * (z * (x - y));
    	}
    	return tmp;
    }
    
    function code(x, y, z)
    	tmp = 0.0
    	if (z <= -0.2)
    		tmp = Float64(Float64(6.0 * Float64(y - x)) * z);
    	elseif (z <= 3.15e-10)
    		tmp = fma(Float64(y * z), 6.0, x);
    	else
    		tmp = Float64(-6.0 * Float64(z * Float64(x - y)));
    	end
    	return tmp
    end
    
    code[x_, y_, z_] := If[LessEqual[z, -0.2], N[(N[(6.0 * N[(y - x), $MachinePrecision]), $MachinePrecision] * z), $MachinePrecision], If[LessEqual[z, 3.15e-10], N[(N[(y * z), $MachinePrecision] * 6.0 + x), $MachinePrecision], N[(-6.0 * N[(z * N[(x - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    \mathbf{if}\;z \leq -0.2:\\
    \;\;\;\;\left(6 \cdot \left(y - x\right)\right) \cdot z\\
    
    \mathbf{elif}\;z \leq 3.15 \cdot 10^{-10}:\\
    \;\;\;\;\mathsf{fma}\left(y \cdot z, 6, x\right)\\
    
    \mathbf{else}:\\
    \;\;\;\;-6 \cdot \left(z \cdot \left(x - y\right)\right)\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 3 regimes
    2. if z < -0.20000000000000001

      1. Initial program 99.7%

        \[x + \left(\left(y - x\right) \cdot 6\right) \cdot z \]
      2. Step-by-step derivation
        1. lift-+.f64N/A

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

          \[\leadsto \color{blue}{\left(\left(y - x\right) \cdot 6\right) \cdot z + x} \]
        3. add-flipN/A

          \[\leadsto \color{blue}{\left(\left(y - x\right) \cdot 6\right) \cdot z - \left(\mathsf{neg}\left(x\right)\right)} \]
        4. *-lft-identityN/A

          \[\leadsto \left(\left(y - x\right) \cdot 6\right) \cdot z - \color{blue}{1 \cdot \left(\mathsf{neg}\left(x\right)\right)} \]
        5. fp-cancel-sub-sign-invN/A

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

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

          \[\leadsto \color{blue}{\left(\left(y - x\right) \cdot 6\right)} \cdot z + \left(\mathsf{neg}\left(1\right)\right) \cdot \left(\mathsf{neg}\left(x\right)\right) \]
        8. associate-*l*N/A

          \[\leadsto \color{blue}{\left(y - x\right) \cdot \left(6 \cdot z\right)} + \left(\mathsf{neg}\left(1\right)\right) \cdot \left(\mathsf{neg}\left(x\right)\right) \]
        9. *-commutativeN/A

          \[\leadsto \left(y - x\right) \cdot \color{blue}{\left(z \cdot 6\right)} + \left(\mathsf{neg}\left(1\right)\right) \cdot \left(\mathsf{neg}\left(x\right)\right) \]
        10. associate-*r*N/A

          \[\leadsto \color{blue}{\left(\left(y - x\right) \cdot z\right) \cdot 6} + \left(\mathsf{neg}\left(1\right)\right) \cdot \left(\mathsf{neg}\left(x\right)\right) \]
        11. *-commutativeN/A

          \[\leadsto \color{blue}{\left(z \cdot \left(y - x\right)\right)} \cdot 6 + \left(\mathsf{neg}\left(1\right)\right) \cdot \left(\mathsf{neg}\left(x\right)\right) \]
        12. remove-double-negN/A

          \[\leadsto \left(z \cdot \left(y - x\right)\right) \cdot \color{blue}{\left(\mathsf{neg}\left(\left(\mathsf{neg}\left(6\right)\right)\right)\right)} + \left(\mathsf{neg}\left(1\right)\right) \cdot \left(\mathsf{neg}\left(x\right)\right) \]
        13. distribute-rgt-neg-outN/A

          \[\leadsto \color{blue}{\left(\mathsf{neg}\left(\left(z \cdot \left(y - x\right)\right) \cdot \left(\mathsf{neg}\left(6\right)\right)\right)\right)} + \left(\mathsf{neg}\left(1\right)\right) \cdot \left(\mathsf{neg}\left(x\right)\right) \]
        14. distribute-lft-neg-inN/A

          \[\leadsto \color{blue}{\left(\mathsf{neg}\left(z \cdot \left(y - x\right)\right)\right) \cdot \left(\mathsf{neg}\left(6\right)\right)} + \left(\mathsf{neg}\left(1\right)\right) \cdot \left(\mathsf{neg}\left(x\right)\right) \]
        15. distribute-lft-neg-outN/A

          \[\leadsto \left(\mathsf{neg}\left(z \cdot \left(y - x\right)\right)\right) \cdot \left(\mathsf{neg}\left(6\right)\right) + \color{blue}{\left(\mathsf{neg}\left(1 \cdot \left(\mathsf{neg}\left(x\right)\right)\right)\right)} \]
        16. *-lft-identityN/A

          \[\leadsto \left(\mathsf{neg}\left(z \cdot \left(y - x\right)\right)\right) \cdot \left(\mathsf{neg}\left(6\right)\right) + \left(\mathsf{neg}\left(\color{blue}{\left(\mathsf{neg}\left(x\right)\right)}\right)\right) \]
        17. remove-double-negN/A

          \[\leadsto \left(\mathsf{neg}\left(z \cdot \left(y - x\right)\right)\right) \cdot \left(\mathsf{neg}\left(6\right)\right) + \color{blue}{x} \]
        18. lower-fma.f64N/A

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

          \[\leadsto \mathsf{fma}\left(\mathsf{neg}\left(\color{blue}{\left(y - x\right) \cdot z}\right), \mathsf{neg}\left(6\right), x\right) \]
        20. distribute-lft-neg-outN/A

          \[\leadsto \mathsf{fma}\left(\color{blue}{\left(\mathsf{neg}\left(\left(y - x\right)\right)\right) \cdot z}, \mathsf{neg}\left(6\right), x\right) \]
        21. lift--.f64N/A

          \[\leadsto \mathsf{fma}\left(\left(\mathsf{neg}\left(\color{blue}{\left(y - x\right)}\right)\right) \cdot z, \mathsf{neg}\left(6\right), x\right) \]
        22. sub-negate-revN/A

          \[\leadsto \mathsf{fma}\left(\color{blue}{\left(x - y\right)} \cdot z, \mathsf{neg}\left(6\right), x\right) \]
        23. lower-*.f64N/A

          \[\leadsto \mathsf{fma}\left(\color{blue}{\left(x - y\right) \cdot z}, \mathsf{neg}\left(6\right), x\right) \]
        24. lower--.f64N/A

          \[\leadsto \mathsf{fma}\left(\color{blue}{\left(x - y\right)} \cdot z, \mathsf{neg}\left(6\right), x\right) \]
        25. metadata-eval99.8

          \[\leadsto \mathsf{fma}\left(\left(x - y\right) \cdot z, \color{blue}{-6}, x\right) \]
      3. Applied rewrites99.8%

        \[\leadsto \color{blue}{\mathsf{fma}\left(\left(x - y\right) \cdot z, -6, x\right)} \]
      4. Taylor expanded in z around inf

        \[\leadsto \color{blue}{-6 \cdot \left(z \cdot \left(x - y\right)\right)} \]
      5. Step-by-step derivation
        1. lower-*.f64N/A

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

          \[\leadsto -6 \cdot \left(z \cdot \color{blue}{\left(x - y\right)}\right) \]
        3. lower--.f6466.0

          \[\leadsto -6 \cdot \left(z \cdot \left(x - \color{blue}{y}\right)\right) \]
      6. Applied rewrites66.0%

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

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

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

          \[\leadsto -6 \cdot \left(z \cdot \left(x - \color{blue}{y}\right)\right) \]
        4. sub-negate-revN/A

          \[\leadsto -6 \cdot \left(z \cdot \left(\mathsf{neg}\left(\left(y - x\right)\right)\right)\right) \]
        5. distribute-rgt-neg-outN/A

          \[\leadsto -6 \cdot \left(\mathsf{neg}\left(z \cdot \left(y - x\right)\right)\right) \]
        6. distribute-rgt-neg-outN/A

          \[\leadsto \mathsf{neg}\left(-6 \cdot \left(z \cdot \left(y - x\right)\right)\right) \]
        7. distribute-lft-neg-outN/A

          \[\leadsto \left(\mathsf{neg}\left(-6\right)\right) \cdot \color{blue}{\left(z \cdot \left(y - x\right)\right)} \]
        8. metadata-evalN/A

          \[\leadsto 6 \cdot \left(\color{blue}{z} \cdot \left(y - x\right)\right) \]
        9. *-commutativeN/A

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

          \[\leadsto z \cdot \color{blue}{\left(\left(y - x\right) \cdot 6\right)} \]
        11. *-commutativeN/A

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

          \[\leadsto \left(\left(y - x\right) \cdot 6\right) \cdot \color{blue}{z} \]
        13. *-commutativeN/A

          \[\leadsto \left(6 \cdot \left(y - x\right)\right) \cdot z \]
        14. lower-*.f64N/A

          \[\leadsto \left(6 \cdot \left(y - x\right)\right) \cdot z \]
        15. lower--.f6466.0

          \[\leadsto \left(6 \cdot \left(y - x\right)\right) \cdot z \]
      8. Applied rewrites66.0%

        \[\leadsto \left(6 \cdot \left(y - x\right)\right) \cdot \color{blue}{z} \]

      if -0.20000000000000001 < z < 3.14999999999999998e-10

      1. Initial program 99.7%

        \[x + \left(\left(y - x\right) \cdot 6\right) \cdot z \]
      2. Taylor expanded in x around 0

        \[\leadsto x + \left(\color{blue}{y} \cdot 6\right) \cdot z \]
      3. Step-by-step derivation
        1. Applied rewrites75.8%

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

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

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

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

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

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

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

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

            \[\leadsto \color{blue}{\mathsf{fma}\left(y \cdot z, 6, x\right)} \]
          9. lower-*.f6475.9

            \[\leadsto \mathsf{fma}\left(\color{blue}{y \cdot z}, 6, x\right) \]
        3. Applied rewrites75.9%

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

        if 3.14999999999999998e-10 < z

        1. Initial program 99.7%

          \[x + \left(\left(y - x\right) \cdot 6\right) \cdot z \]
        2. Step-by-step derivation
          1. lift-+.f64N/A

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

            \[\leadsto \color{blue}{\left(\left(y - x\right) \cdot 6\right) \cdot z + x} \]
          3. add-flipN/A

            \[\leadsto \color{blue}{\left(\left(y - x\right) \cdot 6\right) \cdot z - \left(\mathsf{neg}\left(x\right)\right)} \]
          4. *-lft-identityN/A

            \[\leadsto \left(\left(y - x\right) \cdot 6\right) \cdot z - \color{blue}{1 \cdot \left(\mathsf{neg}\left(x\right)\right)} \]
          5. fp-cancel-sub-sign-invN/A

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

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

            \[\leadsto \color{blue}{\left(\left(y - x\right) \cdot 6\right)} \cdot z + \left(\mathsf{neg}\left(1\right)\right) \cdot \left(\mathsf{neg}\left(x\right)\right) \]
          8. associate-*l*N/A

            \[\leadsto \color{blue}{\left(y - x\right) \cdot \left(6 \cdot z\right)} + \left(\mathsf{neg}\left(1\right)\right) \cdot \left(\mathsf{neg}\left(x\right)\right) \]
          9. *-commutativeN/A

            \[\leadsto \left(y - x\right) \cdot \color{blue}{\left(z \cdot 6\right)} + \left(\mathsf{neg}\left(1\right)\right) \cdot \left(\mathsf{neg}\left(x\right)\right) \]
          10. associate-*r*N/A

            \[\leadsto \color{blue}{\left(\left(y - x\right) \cdot z\right) \cdot 6} + \left(\mathsf{neg}\left(1\right)\right) \cdot \left(\mathsf{neg}\left(x\right)\right) \]
          11. *-commutativeN/A

            \[\leadsto \color{blue}{\left(z \cdot \left(y - x\right)\right)} \cdot 6 + \left(\mathsf{neg}\left(1\right)\right) \cdot \left(\mathsf{neg}\left(x\right)\right) \]
          12. remove-double-negN/A

            \[\leadsto \left(z \cdot \left(y - x\right)\right) \cdot \color{blue}{\left(\mathsf{neg}\left(\left(\mathsf{neg}\left(6\right)\right)\right)\right)} + \left(\mathsf{neg}\left(1\right)\right) \cdot \left(\mathsf{neg}\left(x\right)\right) \]
          13. distribute-rgt-neg-outN/A

            \[\leadsto \color{blue}{\left(\mathsf{neg}\left(\left(z \cdot \left(y - x\right)\right) \cdot \left(\mathsf{neg}\left(6\right)\right)\right)\right)} + \left(\mathsf{neg}\left(1\right)\right) \cdot \left(\mathsf{neg}\left(x\right)\right) \]
          14. distribute-lft-neg-inN/A

            \[\leadsto \color{blue}{\left(\mathsf{neg}\left(z \cdot \left(y - x\right)\right)\right) \cdot \left(\mathsf{neg}\left(6\right)\right)} + \left(\mathsf{neg}\left(1\right)\right) \cdot \left(\mathsf{neg}\left(x\right)\right) \]
          15. distribute-lft-neg-outN/A

            \[\leadsto \left(\mathsf{neg}\left(z \cdot \left(y - x\right)\right)\right) \cdot \left(\mathsf{neg}\left(6\right)\right) + \color{blue}{\left(\mathsf{neg}\left(1 \cdot \left(\mathsf{neg}\left(x\right)\right)\right)\right)} \]
          16. *-lft-identityN/A

            \[\leadsto \left(\mathsf{neg}\left(z \cdot \left(y - x\right)\right)\right) \cdot \left(\mathsf{neg}\left(6\right)\right) + \left(\mathsf{neg}\left(\color{blue}{\left(\mathsf{neg}\left(x\right)\right)}\right)\right) \]
          17. remove-double-negN/A

            \[\leadsto \left(\mathsf{neg}\left(z \cdot \left(y - x\right)\right)\right) \cdot \left(\mathsf{neg}\left(6\right)\right) + \color{blue}{x} \]
          18. lower-fma.f64N/A

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

            \[\leadsto \mathsf{fma}\left(\mathsf{neg}\left(\color{blue}{\left(y - x\right) \cdot z}\right), \mathsf{neg}\left(6\right), x\right) \]
          20. distribute-lft-neg-outN/A

            \[\leadsto \mathsf{fma}\left(\color{blue}{\left(\mathsf{neg}\left(\left(y - x\right)\right)\right) \cdot z}, \mathsf{neg}\left(6\right), x\right) \]
          21. lift--.f64N/A

            \[\leadsto \mathsf{fma}\left(\left(\mathsf{neg}\left(\color{blue}{\left(y - x\right)}\right)\right) \cdot z, \mathsf{neg}\left(6\right), x\right) \]
          22. sub-negate-revN/A

            \[\leadsto \mathsf{fma}\left(\color{blue}{\left(x - y\right)} \cdot z, \mathsf{neg}\left(6\right), x\right) \]
          23. lower-*.f64N/A

            \[\leadsto \mathsf{fma}\left(\color{blue}{\left(x - y\right) \cdot z}, \mathsf{neg}\left(6\right), x\right) \]
          24. lower--.f64N/A

            \[\leadsto \mathsf{fma}\left(\color{blue}{\left(x - y\right)} \cdot z, \mathsf{neg}\left(6\right), x\right) \]
          25. metadata-eval99.8

            \[\leadsto \mathsf{fma}\left(\left(x - y\right) \cdot z, \color{blue}{-6}, x\right) \]
        3. Applied rewrites99.8%

          \[\leadsto \color{blue}{\mathsf{fma}\left(\left(x - y\right) \cdot z, -6, x\right)} \]
        4. Taylor expanded in z around inf

          \[\leadsto \color{blue}{-6 \cdot \left(z \cdot \left(x - y\right)\right)} \]
        5. Step-by-step derivation
          1. lower-*.f64N/A

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

            \[\leadsto -6 \cdot \left(z \cdot \color{blue}{\left(x - y\right)}\right) \]
          3. lower--.f6466.0

            \[\leadsto -6 \cdot \left(z \cdot \left(x - \color{blue}{y}\right)\right) \]
        6. Applied rewrites66.0%

          \[\leadsto \color{blue}{-6 \cdot \left(z \cdot \left(x - y\right)\right)} \]
      4. Recombined 3 regimes into one program.
      5. Add Preprocessing

      Alternative 4: 98.6% accurate, 0.7× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} t_0 := -6 \cdot \left(z \cdot \left(x - y\right)\right)\\ \mathbf{if}\;z \leq -0.16:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;z \leq 3.15 \cdot 10^{-10}:\\ \;\;\;\;\mathsf{fma}\left(y \cdot z, 6, x\right)\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
      (FPCore (x y z)
       :precision binary64
       (let* ((t_0 (* -6.0 (* z (- x y)))))
         (if (<= z -0.16) t_0 (if (<= z 3.15e-10) (fma (* y z) 6.0 x) t_0))))
      double code(double x, double y, double z) {
      	double t_0 = -6.0 * (z * (x - y));
      	double tmp;
      	if (z <= -0.16) {
      		tmp = t_0;
      	} else if (z <= 3.15e-10) {
      		tmp = fma((y * z), 6.0, x);
      	} else {
      		tmp = t_0;
      	}
      	return tmp;
      }
      
      function code(x, y, z)
      	t_0 = Float64(-6.0 * Float64(z * Float64(x - y)))
      	tmp = 0.0
      	if (z <= -0.16)
      		tmp = t_0;
      	elseif (z <= 3.15e-10)
      		tmp = fma(Float64(y * z), 6.0, x);
      	else
      		tmp = t_0;
      	end
      	return tmp
      end
      
      code[x_, y_, z_] := Block[{t$95$0 = N[(-6.0 * N[(z * N[(x - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -0.16], t$95$0, If[LessEqual[z, 3.15e-10], N[(N[(y * z), $MachinePrecision] * 6.0 + x), $MachinePrecision], t$95$0]]]
      
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      t_0 := -6 \cdot \left(z \cdot \left(x - y\right)\right)\\
      \mathbf{if}\;z \leq -0.16:\\
      \;\;\;\;t\_0\\
      
      \mathbf{elif}\;z \leq 3.15 \cdot 10^{-10}:\\
      \;\;\;\;\mathsf{fma}\left(y \cdot z, 6, x\right)\\
      
      \mathbf{else}:\\
      \;\;\;\;t\_0\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 2 regimes
      2. if z < -0.160000000000000003 or 3.14999999999999998e-10 < z

        1. Initial program 99.7%

          \[x + \left(\left(y - x\right) \cdot 6\right) \cdot z \]
        2. Step-by-step derivation
          1. lift-+.f64N/A

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

            \[\leadsto \color{blue}{\left(\left(y - x\right) \cdot 6\right) \cdot z + x} \]
          3. add-flipN/A

            \[\leadsto \color{blue}{\left(\left(y - x\right) \cdot 6\right) \cdot z - \left(\mathsf{neg}\left(x\right)\right)} \]
          4. *-lft-identityN/A

            \[\leadsto \left(\left(y - x\right) \cdot 6\right) \cdot z - \color{blue}{1 \cdot \left(\mathsf{neg}\left(x\right)\right)} \]
          5. fp-cancel-sub-sign-invN/A

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

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

            \[\leadsto \color{blue}{\left(\left(y - x\right) \cdot 6\right)} \cdot z + \left(\mathsf{neg}\left(1\right)\right) \cdot \left(\mathsf{neg}\left(x\right)\right) \]
          8. associate-*l*N/A

            \[\leadsto \color{blue}{\left(y - x\right) \cdot \left(6 \cdot z\right)} + \left(\mathsf{neg}\left(1\right)\right) \cdot \left(\mathsf{neg}\left(x\right)\right) \]
          9. *-commutativeN/A

            \[\leadsto \left(y - x\right) \cdot \color{blue}{\left(z \cdot 6\right)} + \left(\mathsf{neg}\left(1\right)\right) \cdot \left(\mathsf{neg}\left(x\right)\right) \]
          10. associate-*r*N/A

            \[\leadsto \color{blue}{\left(\left(y - x\right) \cdot z\right) \cdot 6} + \left(\mathsf{neg}\left(1\right)\right) \cdot \left(\mathsf{neg}\left(x\right)\right) \]
          11. *-commutativeN/A

            \[\leadsto \color{blue}{\left(z \cdot \left(y - x\right)\right)} \cdot 6 + \left(\mathsf{neg}\left(1\right)\right) \cdot \left(\mathsf{neg}\left(x\right)\right) \]
          12. remove-double-negN/A

            \[\leadsto \left(z \cdot \left(y - x\right)\right) \cdot \color{blue}{\left(\mathsf{neg}\left(\left(\mathsf{neg}\left(6\right)\right)\right)\right)} + \left(\mathsf{neg}\left(1\right)\right) \cdot \left(\mathsf{neg}\left(x\right)\right) \]
          13. distribute-rgt-neg-outN/A

            \[\leadsto \color{blue}{\left(\mathsf{neg}\left(\left(z \cdot \left(y - x\right)\right) \cdot \left(\mathsf{neg}\left(6\right)\right)\right)\right)} + \left(\mathsf{neg}\left(1\right)\right) \cdot \left(\mathsf{neg}\left(x\right)\right) \]
          14. distribute-lft-neg-inN/A

            \[\leadsto \color{blue}{\left(\mathsf{neg}\left(z \cdot \left(y - x\right)\right)\right) \cdot \left(\mathsf{neg}\left(6\right)\right)} + \left(\mathsf{neg}\left(1\right)\right) \cdot \left(\mathsf{neg}\left(x\right)\right) \]
          15. distribute-lft-neg-outN/A

            \[\leadsto \left(\mathsf{neg}\left(z \cdot \left(y - x\right)\right)\right) \cdot \left(\mathsf{neg}\left(6\right)\right) + \color{blue}{\left(\mathsf{neg}\left(1 \cdot \left(\mathsf{neg}\left(x\right)\right)\right)\right)} \]
          16. *-lft-identityN/A

            \[\leadsto \left(\mathsf{neg}\left(z \cdot \left(y - x\right)\right)\right) \cdot \left(\mathsf{neg}\left(6\right)\right) + \left(\mathsf{neg}\left(\color{blue}{\left(\mathsf{neg}\left(x\right)\right)}\right)\right) \]
          17. remove-double-negN/A

            \[\leadsto \left(\mathsf{neg}\left(z \cdot \left(y - x\right)\right)\right) \cdot \left(\mathsf{neg}\left(6\right)\right) + \color{blue}{x} \]
          18. lower-fma.f64N/A

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

            \[\leadsto \mathsf{fma}\left(\mathsf{neg}\left(\color{blue}{\left(y - x\right) \cdot z}\right), \mathsf{neg}\left(6\right), x\right) \]
          20. distribute-lft-neg-outN/A

            \[\leadsto \mathsf{fma}\left(\color{blue}{\left(\mathsf{neg}\left(\left(y - x\right)\right)\right) \cdot z}, \mathsf{neg}\left(6\right), x\right) \]
          21. lift--.f64N/A

            \[\leadsto \mathsf{fma}\left(\left(\mathsf{neg}\left(\color{blue}{\left(y - x\right)}\right)\right) \cdot z, \mathsf{neg}\left(6\right), x\right) \]
          22. sub-negate-revN/A

            \[\leadsto \mathsf{fma}\left(\color{blue}{\left(x - y\right)} \cdot z, \mathsf{neg}\left(6\right), x\right) \]
          23. lower-*.f64N/A

            \[\leadsto \mathsf{fma}\left(\color{blue}{\left(x - y\right) \cdot z}, \mathsf{neg}\left(6\right), x\right) \]
          24. lower--.f64N/A

            \[\leadsto \mathsf{fma}\left(\color{blue}{\left(x - y\right)} \cdot z, \mathsf{neg}\left(6\right), x\right) \]
          25. metadata-eval99.8

            \[\leadsto \mathsf{fma}\left(\left(x - y\right) \cdot z, \color{blue}{-6}, x\right) \]
        3. Applied rewrites99.8%

          \[\leadsto \color{blue}{\mathsf{fma}\left(\left(x - y\right) \cdot z, -6, x\right)} \]
        4. Taylor expanded in z around inf

          \[\leadsto \color{blue}{-6 \cdot \left(z \cdot \left(x - y\right)\right)} \]
        5. Step-by-step derivation
          1. lower-*.f64N/A

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

            \[\leadsto -6 \cdot \left(z \cdot \color{blue}{\left(x - y\right)}\right) \]
          3. lower--.f6466.0

            \[\leadsto -6 \cdot \left(z \cdot \left(x - \color{blue}{y}\right)\right) \]
        6. Applied rewrites66.0%

          \[\leadsto \color{blue}{-6 \cdot \left(z \cdot \left(x - y\right)\right)} \]

        if -0.160000000000000003 < z < 3.14999999999999998e-10

        1. Initial program 99.7%

          \[x + \left(\left(y - x\right) \cdot 6\right) \cdot z \]
        2. Taylor expanded in x around 0

          \[\leadsto x + \left(\color{blue}{y} \cdot 6\right) \cdot z \]
        3. Step-by-step derivation
          1. Applied rewrites75.8%

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

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

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

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

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

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

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

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

              \[\leadsto \color{blue}{\mathsf{fma}\left(y \cdot z, 6, x\right)} \]
            9. lower-*.f6475.9

              \[\leadsto \mathsf{fma}\left(\color{blue}{y \cdot z}, 6, x\right) \]
          3. Applied rewrites75.9%

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

        Alternative 5: 86.2% accurate, 0.7× speedup?

        \[\begin{array}{l} \\ \begin{array}{l} t_0 := \mathsf{fma}\left(-6 \cdot z, x, x\right)\\ \mathbf{if}\;x \leq -2.4 \cdot 10^{+29}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;x \leq 1.85 \cdot 10^{+46}:\\ \;\;\;\;\mathsf{fma}\left(y \cdot z, 6, x\right)\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
        (FPCore (x y z)
         :precision binary64
         (let* ((t_0 (fma (* -6.0 z) x x)))
           (if (<= x -2.4e+29) t_0 (if (<= x 1.85e+46) (fma (* y z) 6.0 x) t_0))))
        double code(double x, double y, double z) {
        	double t_0 = fma((-6.0 * z), x, x);
        	double tmp;
        	if (x <= -2.4e+29) {
        		tmp = t_0;
        	} else if (x <= 1.85e+46) {
        		tmp = fma((y * z), 6.0, x);
        	} else {
        		tmp = t_0;
        	}
        	return tmp;
        }
        
        function code(x, y, z)
        	t_0 = fma(Float64(-6.0 * z), x, x)
        	tmp = 0.0
        	if (x <= -2.4e+29)
        		tmp = t_0;
        	elseif (x <= 1.85e+46)
        		tmp = fma(Float64(y * z), 6.0, x);
        	else
        		tmp = t_0;
        	end
        	return tmp
        end
        
        code[x_, y_, z_] := Block[{t$95$0 = N[(N[(-6.0 * z), $MachinePrecision] * x + x), $MachinePrecision]}, If[LessEqual[x, -2.4e+29], t$95$0, If[LessEqual[x, 1.85e+46], N[(N[(y * z), $MachinePrecision] * 6.0 + x), $MachinePrecision], t$95$0]]]
        
        \begin{array}{l}
        
        \\
        \begin{array}{l}
        t_0 := \mathsf{fma}\left(-6 \cdot z, x, x\right)\\
        \mathbf{if}\;x \leq -2.4 \cdot 10^{+29}:\\
        \;\;\;\;t\_0\\
        
        \mathbf{elif}\;x \leq 1.85 \cdot 10^{+46}:\\
        \;\;\;\;\mathsf{fma}\left(y \cdot z, 6, x\right)\\
        
        \mathbf{else}:\\
        \;\;\;\;t\_0\\
        
        
        \end{array}
        \end{array}
        
        Derivation
        1. Split input into 2 regimes
        2. if x < -2.4000000000000001e29 or 1.84999999999999995e46 < x

          1. Initial program 99.7%

            \[x + \left(\left(y - x\right) \cdot 6\right) \cdot z \]
          2. Step-by-step derivation
            1. lift-+.f64N/A

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

              \[\leadsto \color{blue}{\left(\left(y - x\right) \cdot 6\right) \cdot z + x} \]
            3. add-flipN/A

              \[\leadsto \color{blue}{\left(\left(y - x\right) \cdot 6\right) \cdot z - \left(\mathsf{neg}\left(x\right)\right)} \]
            4. *-lft-identityN/A

              \[\leadsto \left(\left(y - x\right) \cdot 6\right) \cdot z - \color{blue}{1 \cdot \left(\mathsf{neg}\left(x\right)\right)} \]
            5. fp-cancel-sub-sign-invN/A

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

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

              \[\leadsto \color{blue}{\left(\left(y - x\right) \cdot 6\right)} \cdot z + \left(\mathsf{neg}\left(1\right)\right) \cdot \left(\mathsf{neg}\left(x\right)\right) \]
            8. associate-*l*N/A

              \[\leadsto \color{blue}{\left(y - x\right) \cdot \left(6 \cdot z\right)} + \left(\mathsf{neg}\left(1\right)\right) \cdot \left(\mathsf{neg}\left(x\right)\right) \]
            9. *-commutativeN/A

              \[\leadsto \left(y - x\right) \cdot \color{blue}{\left(z \cdot 6\right)} + \left(\mathsf{neg}\left(1\right)\right) \cdot \left(\mathsf{neg}\left(x\right)\right) \]
            10. associate-*r*N/A

              \[\leadsto \color{blue}{\left(\left(y - x\right) \cdot z\right) \cdot 6} + \left(\mathsf{neg}\left(1\right)\right) \cdot \left(\mathsf{neg}\left(x\right)\right) \]
            11. *-commutativeN/A

              \[\leadsto \color{blue}{\left(z \cdot \left(y - x\right)\right)} \cdot 6 + \left(\mathsf{neg}\left(1\right)\right) \cdot \left(\mathsf{neg}\left(x\right)\right) \]
            12. remove-double-negN/A

              \[\leadsto \left(z \cdot \left(y - x\right)\right) \cdot \color{blue}{\left(\mathsf{neg}\left(\left(\mathsf{neg}\left(6\right)\right)\right)\right)} + \left(\mathsf{neg}\left(1\right)\right) \cdot \left(\mathsf{neg}\left(x\right)\right) \]
            13. distribute-rgt-neg-outN/A

              \[\leadsto \color{blue}{\left(\mathsf{neg}\left(\left(z \cdot \left(y - x\right)\right) \cdot \left(\mathsf{neg}\left(6\right)\right)\right)\right)} + \left(\mathsf{neg}\left(1\right)\right) \cdot \left(\mathsf{neg}\left(x\right)\right) \]
            14. distribute-lft-neg-inN/A

              \[\leadsto \color{blue}{\left(\mathsf{neg}\left(z \cdot \left(y - x\right)\right)\right) \cdot \left(\mathsf{neg}\left(6\right)\right)} + \left(\mathsf{neg}\left(1\right)\right) \cdot \left(\mathsf{neg}\left(x\right)\right) \]
            15. distribute-lft-neg-outN/A

              \[\leadsto \left(\mathsf{neg}\left(z \cdot \left(y - x\right)\right)\right) \cdot \left(\mathsf{neg}\left(6\right)\right) + \color{blue}{\left(\mathsf{neg}\left(1 \cdot \left(\mathsf{neg}\left(x\right)\right)\right)\right)} \]
            16. *-lft-identityN/A

              \[\leadsto \left(\mathsf{neg}\left(z \cdot \left(y - x\right)\right)\right) \cdot \left(\mathsf{neg}\left(6\right)\right) + \left(\mathsf{neg}\left(\color{blue}{\left(\mathsf{neg}\left(x\right)\right)}\right)\right) \]
            17. remove-double-negN/A

              \[\leadsto \left(\mathsf{neg}\left(z \cdot \left(y - x\right)\right)\right) \cdot \left(\mathsf{neg}\left(6\right)\right) + \color{blue}{x} \]
            18. lower-fma.f64N/A

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

              \[\leadsto \mathsf{fma}\left(\mathsf{neg}\left(\color{blue}{\left(y - x\right) \cdot z}\right), \mathsf{neg}\left(6\right), x\right) \]
            20. distribute-lft-neg-outN/A

              \[\leadsto \mathsf{fma}\left(\color{blue}{\left(\mathsf{neg}\left(\left(y - x\right)\right)\right) \cdot z}, \mathsf{neg}\left(6\right), x\right) \]
            21. lift--.f64N/A

              \[\leadsto \mathsf{fma}\left(\left(\mathsf{neg}\left(\color{blue}{\left(y - x\right)}\right)\right) \cdot z, \mathsf{neg}\left(6\right), x\right) \]
            22. sub-negate-revN/A

              \[\leadsto \mathsf{fma}\left(\color{blue}{\left(x - y\right)} \cdot z, \mathsf{neg}\left(6\right), x\right) \]
            23. lower-*.f64N/A

              \[\leadsto \mathsf{fma}\left(\color{blue}{\left(x - y\right) \cdot z}, \mathsf{neg}\left(6\right), x\right) \]
            24. lower--.f64N/A

              \[\leadsto \mathsf{fma}\left(\color{blue}{\left(x - y\right)} \cdot z, \mathsf{neg}\left(6\right), x\right) \]
            25. metadata-eval99.8

              \[\leadsto \mathsf{fma}\left(\left(x - y\right) \cdot z, \color{blue}{-6}, x\right) \]
          3. Applied rewrites99.8%

            \[\leadsto \color{blue}{\mathsf{fma}\left(\left(x - y\right) \cdot z, -6, x\right)} \]
          4. Taylor expanded in x around inf

            \[\leadsto \color{blue}{x \cdot \left(1 + -6 \cdot z\right)} \]
          5. Step-by-step derivation
            1. lower-*.f64N/A

              \[\leadsto x \cdot \color{blue}{\left(1 + -6 \cdot z\right)} \]
            2. lower-+.f64N/A

              \[\leadsto x \cdot \left(1 + \color{blue}{-6 \cdot z}\right) \]
            3. lower-*.f6460.6

              \[\leadsto x \cdot \left(1 + -6 \cdot \color{blue}{z}\right) \]
          6. Applied rewrites60.6%

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

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

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

              \[\leadsto \left(1 + -6 \cdot z\right) \cdot x \]
            4. +-commutativeN/A

              \[\leadsto \left(-6 \cdot z + 1\right) \cdot x \]
            5. distribute-lft1-inN/A

              \[\leadsto \left(-6 \cdot z\right) \cdot x + \color{blue}{x} \]
            6. lower-fma.f6460.6

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

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

          if -2.4000000000000001e29 < x < 1.84999999999999995e46

          1. Initial program 99.7%

            \[x + \left(\left(y - x\right) \cdot 6\right) \cdot z \]
          2. Taylor expanded in x around 0

            \[\leadsto x + \left(\color{blue}{y} \cdot 6\right) \cdot z \]
          3. Step-by-step derivation
            1. Applied rewrites75.8%

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

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

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

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

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

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

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

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

                \[\leadsto \color{blue}{\mathsf{fma}\left(y \cdot z, 6, x\right)} \]
              9. lower-*.f6475.9

                \[\leadsto \mathsf{fma}\left(\color{blue}{y \cdot z}, 6, x\right) \]
            3. Applied rewrites75.9%

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

          Alternative 6: 74.7% accurate, 0.7× speedup?

          \[\begin{array}{l} \\ \begin{array}{l} t_0 := \mathsf{fma}\left(-6 \cdot z, x, x\right)\\ \mathbf{if}\;x \leq -1.35 \cdot 10^{-140}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;x \leq 8.2 \cdot 10^{-82}:\\ \;\;\;\;\left(6 \cdot z\right) \cdot y\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
          (FPCore (x y z)
           :precision binary64
           (let* ((t_0 (fma (* -6.0 z) x x)))
             (if (<= x -1.35e-140) t_0 (if (<= x 8.2e-82) (* (* 6.0 z) y) t_0))))
          double code(double x, double y, double z) {
          	double t_0 = fma((-6.0 * z), x, x);
          	double tmp;
          	if (x <= -1.35e-140) {
          		tmp = t_0;
          	} else if (x <= 8.2e-82) {
          		tmp = (6.0 * z) * y;
          	} else {
          		tmp = t_0;
          	}
          	return tmp;
          }
          
          function code(x, y, z)
          	t_0 = fma(Float64(-6.0 * z), x, x)
          	tmp = 0.0
          	if (x <= -1.35e-140)
          		tmp = t_0;
          	elseif (x <= 8.2e-82)
          		tmp = Float64(Float64(6.0 * z) * y);
          	else
          		tmp = t_0;
          	end
          	return tmp
          end
          
          code[x_, y_, z_] := Block[{t$95$0 = N[(N[(-6.0 * z), $MachinePrecision] * x + x), $MachinePrecision]}, If[LessEqual[x, -1.35e-140], t$95$0, If[LessEqual[x, 8.2e-82], N[(N[(6.0 * z), $MachinePrecision] * y), $MachinePrecision], t$95$0]]]
          
          \begin{array}{l}
          
          \\
          \begin{array}{l}
          t_0 := \mathsf{fma}\left(-6 \cdot z, x, x\right)\\
          \mathbf{if}\;x \leq -1.35 \cdot 10^{-140}:\\
          \;\;\;\;t\_0\\
          
          \mathbf{elif}\;x \leq 8.2 \cdot 10^{-82}:\\
          \;\;\;\;\left(6 \cdot z\right) \cdot y\\
          
          \mathbf{else}:\\
          \;\;\;\;t\_0\\
          
          
          \end{array}
          \end{array}
          
          Derivation
          1. Split input into 2 regimes
          2. if x < -1.35e-140 or 8.19999999999999992e-82 < x

            1. Initial program 99.7%

              \[x + \left(\left(y - x\right) \cdot 6\right) \cdot z \]
            2. Step-by-step derivation
              1. lift-+.f64N/A

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

                \[\leadsto \color{blue}{\left(\left(y - x\right) \cdot 6\right) \cdot z + x} \]
              3. add-flipN/A

                \[\leadsto \color{blue}{\left(\left(y - x\right) \cdot 6\right) \cdot z - \left(\mathsf{neg}\left(x\right)\right)} \]
              4. *-lft-identityN/A

                \[\leadsto \left(\left(y - x\right) \cdot 6\right) \cdot z - \color{blue}{1 \cdot \left(\mathsf{neg}\left(x\right)\right)} \]
              5. fp-cancel-sub-sign-invN/A

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

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

                \[\leadsto \color{blue}{\left(\left(y - x\right) \cdot 6\right)} \cdot z + \left(\mathsf{neg}\left(1\right)\right) \cdot \left(\mathsf{neg}\left(x\right)\right) \]
              8. associate-*l*N/A

                \[\leadsto \color{blue}{\left(y - x\right) \cdot \left(6 \cdot z\right)} + \left(\mathsf{neg}\left(1\right)\right) \cdot \left(\mathsf{neg}\left(x\right)\right) \]
              9. *-commutativeN/A

                \[\leadsto \left(y - x\right) \cdot \color{blue}{\left(z \cdot 6\right)} + \left(\mathsf{neg}\left(1\right)\right) \cdot \left(\mathsf{neg}\left(x\right)\right) \]
              10. associate-*r*N/A

                \[\leadsto \color{blue}{\left(\left(y - x\right) \cdot z\right) \cdot 6} + \left(\mathsf{neg}\left(1\right)\right) \cdot \left(\mathsf{neg}\left(x\right)\right) \]
              11. *-commutativeN/A

                \[\leadsto \color{blue}{\left(z \cdot \left(y - x\right)\right)} \cdot 6 + \left(\mathsf{neg}\left(1\right)\right) \cdot \left(\mathsf{neg}\left(x\right)\right) \]
              12. remove-double-negN/A

                \[\leadsto \left(z \cdot \left(y - x\right)\right) \cdot \color{blue}{\left(\mathsf{neg}\left(\left(\mathsf{neg}\left(6\right)\right)\right)\right)} + \left(\mathsf{neg}\left(1\right)\right) \cdot \left(\mathsf{neg}\left(x\right)\right) \]
              13. distribute-rgt-neg-outN/A

                \[\leadsto \color{blue}{\left(\mathsf{neg}\left(\left(z \cdot \left(y - x\right)\right) \cdot \left(\mathsf{neg}\left(6\right)\right)\right)\right)} + \left(\mathsf{neg}\left(1\right)\right) \cdot \left(\mathsf{neg}\left(x\right)\right) \]
              14. distribute-lft-neg-inN/A

                \[\leadsto \color{blue}{\left(\mathsf{neg}\left(z \cdot \left(y - x\right)\right)\right) \cdot \left(\mathsf{neg}\left(6\right)\right)} + \left(\mathsf{neg}\left(1\right)\right) \cdot \left(\mathsf{neg}\left(x\right)\right) \]
              15. distribute-lft-neg-outN/A

                \[\leadsto \left(\mathsf{neg}\left(z \cdot \left(y - x\right)\right)\right) \cdot \left(\mathsf{neg}\left(6\right)\right) + \color{blue}{\left(\mathsf{neg}\left(1 \cdot \left(\mathsf{neg}\left(x\right)\right)\right)\right)} \]
              16. *-lft-identityN/A

                \[\leadsto \left(\mathsf{neg}\left(z \cdot \left(y - x\right)\right)\right) \cdot \left(\mathsf{neg}\left(6\right)\right) + \left(\mathsf{neg}\left(\color{blue}{\left(\mathsf{neg}\left(x\right)\right)}\right)\right) \]
              17. remove-double-negN/A

                \[\leadsto \left(\mathsf{neg}\left(z \cdot \left(y - x\right)\right)\right) \cdot \left(\mathsf{neg}\left(6\right)\right) + \color{blue}{x} \]
              18. lower-fma.f64N/A

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

                \[\leadsto \mathsf{fma}\left(\mathsf{neg}\left(\color{blue}{\left(y - x\right) \cdot z}\right), \mathsf{neg}\left(6\right), x\right) \]
              20. distribute-lft-neg-outN/A

                \[\leadsto \mathsf{fma}\left(\color{blue}{\left(\mathsf{neg}\left(\left(y - x\right)\right)\right) \cdot z}, \mathsf{neg}\left(6\right), x\right) \]
              21. lift--.f64N/A

                \[\leadsto \mathsf{fma}\left(\left(\mathsf{neg}\left(\color{blue}{\left(y - x\right)}\right)\right) \cdot z, \mathsf{neg}\left(6\right), x\right) \]
              22. sub-negate-revN/A

                \[\leadsto \mathsf{fma}\left(\color{blue}{\left(x - y\right)} \cdot z, \mathsf{neg}\left(6\right), x\right) \]
              23. lower-*.f64N/A

                \[\leadsto \mathsf{fma}\left(\color{blue}{\left(x - y\right) \cdot z}, \mathsf{neg}\left(6\right), x\right) \]
              24. lower--.f64N/A

                \[\leadsto \mathsf{fma}\left(\color{blue}{\left(x - y\right)} \cdot z, \mathsf{neg}\left(6\right), x\right) \]
              25. metadata-eval99.8

                \[\leadsto \mathsf{fma}\left(\left(x - y\right) \cdot z, \color{blue}{-6}, x\right) \]
            3. Applied rewrites99.8%

              \[\leadsto \color{blue}{\mathsf{fma}\left(\left(x - y\right) \cdot z, -6, x\right)} \]
            4. Taylor expanded in x around inf

              \[\leadsto \color{blue}{x \cdot \left(1 + -6 \cdot z\right)} \]
            5. Step-by-step derivation
              1. lower-*.f64N/A

                \[\leadsto x \cdot \color{blue}{\left(1 + -6 \cdot z\right)} \]
              2. lower-+.f64N/A

                \[\leadsto x \cdot \left(1 + \color{blue}{-6 \cdot z}\right) \]
              3. lower-*.f6460.6

                \[\leadsto x \cdot \left(1 + -6 \cdot \color{blue}{z}\right) \]
            6. Applied rewrites60.6%

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

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

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

                \[\leadsto \left(1 + -6 \cdot z\right) \cdot x \]
              4. +-commutativeN/A

                \[\leadsto \left(-6 \cdot z + 1\right) \cdot x \]
              5. distribute-lft1-inN/A

                \[\leadsto \left(-6 \cdot z\right) \cdot x + \color{blue}{x} \]
              6. lower-fma.f6460.6

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

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

            if -1.35e-140 < x < 8.19999999999999992e-82

            1. Initial program 99.7%

              \[x + \left(\left(y - x\right) \cdot 6\right) \cdot z \]
            2. Taylor expanded in x around 0

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

                \[\leadsto 6 \cdot \color{blue}{\left(y \cdot z\right)} \]
              2. lower-*.f6442.8

                \[\leadsto 6 \cdot \left(y \cdot \color{blue}{z}\right) \]
            4. Applied rewrites42.8%

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

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

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

                \[\leadsto 6 \cdot \left(z \cdot \color{blue}{y}\right) \]
              4. associate-*l*N/A

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

                \[\leadsto \left(6 \cdot z\right) \cdot \color{blue}{y} \]
              6. lower-*.f6442.8

                \[\leadsto \left(6 \cdot z\right) \cdot y \]
            6. Applied rewrites42.8%

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

          Alternative 7: 74.6% accurate, 0.7× speedup?

          \[\begin{array}{l} \\ \begin{array}{l} t_0 := \mathsf{fma}\left(-6 \cdot x, z, x\right)\\ \mathbf{if}\;x \leq -1.35 \cdot 10^{-140}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;x \leq 8.2 \cdot 10^{-82}:\\ \;\;\;\;\left(6 \cdot z\right) \cdot y\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
          (FPCore (x y z)
           :precision binary64
           (let* ((t_0 (fma (* -6.0 x) z x)))
             (if (<= x -1.35e-140) t_0 (if (<= x 8.2e-82) (* (* 6.0 z) y) t_0))))
          double code(double x, double y, double z) {
          	double t_0 = fma((-6.0 * x), z, x);
          	double tmp;
          	if (x <= -1.35e-140) {
          		tmp = t_0;
          	} else if (x <= 8.2e-82) {
          		tmp = (6.0 * z) * y;
          	} else {
          		tmp = t_0;
          	}
          	return tmp;
          }
          
          function code(x, y, z)
          	t_0 = fma(Float64(-6.0 * x), z, x)
          	tmp = 0.0
          	if (x <= -1.35e-140)
          		tmp = t_0;
          	elseif (x <= 8.2e-82)
          		tmp = Float64(Float64(6.0 * z) * y);
          	else
          		tmp = t_0;
          	end
          	return tmp
          end
          
          code[x_, y_, z_] := Block[{t$95$0 = N[(N[(-6.0 * x), $MachinePrecision] * z + x), $MachinePrecision]}, If[LessEqual[x, -1.35e-140], t$95$0, If[LessEqual[x, 8.2e-82], N[(N[(6.0 * z), $MachinePrecision] * y), $MachinePrecision], t$95$0]]]
          
          \begin{array}{l}
          
          \\
          \begin{array}{l}
          t_0 := \mathsf{fma}\left(-6 \cdot x, z, x\right)\\
          \mathbf{if}\;x \leq -1.35 \cdot 10^{-140}:\\
          \;\;\;\;t\_0\\
          
          \mathbf{elif}\;x \leq 8.2 \cdot 10^{-82}:\\
          \;\;\;\;\left(6 \cdot z\right) \cdot y\\
          
          \mathbf{else}:\\
          \;\;\;\;t\_0\\
          
          
          \end{array}
          \end{array}
          
          Derivation
          1. Split input into 2 regimes
          2. if x < -1.35e-140 or 8.19999999999999992e-82 < x

            1. Initial program 99.7%

              \[x + \left(\left(y - x\right) \cdot 6\right) \cdot z \]
            2. Step-by-step derivation
              1. lift-+.f64N/A

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

                \[\leadsto \color{blue}{\left(\left(y - x\right) \cdot 6\right) \cdot z + x} \]
              3. add-flipN/A

                \[\leadsto \color{blue}{\left(\left(y - x\right) \cdot 6\right) \cdot z - \left(\mathsf{neg}\left(x\right)\right)} \]
              4. *-lft-identityN/A

                \[\leadsto \left(\left(y - x\right) \cdot 6\right) \cdot z - \color{blue}{1 \cdot \left(\mathsf{neg}\left(x\right)\right)} \]
              5. fp-cancel-sub-sign-invN/A

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

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

                \[\leadsto \color{blue}{\left(\left(y - x\right) \cdot 6\right)} \cdot z + \left(\mathsf{neg}\left(1\right)\right) \cdot \left(\mathsf{neg}\left(x\right)\right) \]
              8. associate-*l*N/A

                \[\leadsto \color{blue}{\left(y - x\right) \cdot \left(6 \cdot z\right)} + \left(\mathsf{neg}\left(1\right)\right) \cdot \left(\mathsf{neg}\left(x\right)\right) \]
              9. *-commutativeN/A

                \[\leadsto \left(y - x\right) \cdot \color{blue}{\left(z \cdot 6\right)} + \left(\mathsf{neg}\left(1\right)\right) \cdot \left(\mathsf{neg}\left(x\right)\right) \]
              10. associate-*r*N/A

                \[\leadsto \color{blue}{\left(\left(y - x\right) \cdot z\right) \cdot 6} + \left(\mathsf{neg}\left(1\right)\right) \cdot \left(\mathsf{neg}\left(x\right)\right) \]
              11. *-commutativeN/A

                \[\leadsto \color{blue}{\left(z \cdot \left(y - x\right)\right)} \cdot 6 + \left(\mathsf{neg}\left(1\right)\right) \cdot \left(\mathsf{neg}\left(x\right)\right) \]
              12. remove-double-negN/A

                \[\leadsto \left(z \cdot \left(y - x\right)\right) \cdot \color{blue}{\left(\mathsf{neg}\left(\left(\mathsf{neg}\left(6\right)\right)\right)\right)} + \left(\mathsf{neg}\left(1\right)\right) \cdot \left(\mathsf{neg}\left(x\right)\right) \]
              13. distribute-rgt-neg-outN/A

                \[\leadsto \color{blue}{\left(\mathsf{neg}\left(\left(z \cdot \left(y - x\right)\right) \cdot \left(\mathsf{neg}\left(6\right)\right)\right)\right)} + \left(\mathsf{neg}\left(1\right)\right) \cdot \left(\mathsf{neg}\left(x\right)\right) \]
              14. distribute-lft-neg-inN/A

                \[\leadsto \color{blue}{\left(\mathsf{neg}\left(z \cdot \left(y - x\right)\right)\right) \cdot \left(\mathsf{neg}\left(6\right)\right)} + \left(\mathsf{neg}\left(1\right)\right) \cdot \left(\mathsf{neg}\left(x\right)\right) \]
              15. distribute-lft-neg-outN/A

                \[\leadsto \left(\mathsf{neg}\left(z \cdot \left(y - x\right)\right)\right) \cdot \left(\mathsf{neg}\left(6\right)\right) + \color{blue}{\left(\mathsf{neg}\left(1 \cdot \left(\mathsf{neg}\left(x\right)\right)\right)\right)} \]
              16. *-lft-identityN/A

                \[\leadsto \left(\mathsf{neg}\left(z \cdot \left(y - x\right)\right)\right) \cdot \left(\mathsf{neg}\left(6\right)\right) + \left(\mathsf{neg}\left(\color{blue}{\left(\mathsf{neg}\left(x\right)\right)}\right)\right) \]
              17. remove-double-negN/A

                \[\leadsto \left(\mathsf{neg}\left(z \cdot \left(y - x\right)\right)\right) \cdot \left(\mathsf{neg}\left(6\right)\right) + \color{blue}{x} \]
              18. lower-fma.f64N/A

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

                \[\leadsto \mathsf{fma}\left(\mathsf{neg}\left(\color{blue}{\left(y - x\right) \cdot z}\right), \mathsf{neg}\left(6\right), x\right) \]
              20. distribute-lft-neg-outN/A

                \[\leadsto \mathsf{fma}\left(\color{blue}{\left(\mathsf{neg}\left(\left(y - x\right)\right)\right) \cdot z}, \mathsf{neg}\left(6\right), x\right) \]
              21. lift--.f64N/A

                \[\leadsto \mathsf{fma}\left(\left(\mathsf{neg}\left(\color{blue}{\left(y - x\right)}\right)\right) \cdot z, \mathsf{neg}\left(6\right), x\right) \]
              22. sub-negate-revN/A

                \[\leadsto \mathsf{fma}\left(\color{blue}{\left(x - y\right)} \cdot z, \mathsf{neg}\left(6\right), x\right) \]
              23. lower-*.f64N/A

                \[\leadsto \mathsf{fma}\left(\color{blue}{\left(x - y\right) \cdot z}, \mathsf{neg}\left(6\right), x\right) \]
              24. lower--.f64N/A

                \[\leadsto \mathsf{fma}\left(\color{blue}{\left(x - y\right)} \cdot z, \mathsf{neg}\left(6\right), x\right) \]
              25. metadata-eval99.8

                \[\leadsto \mathsf{fma}\left(\left(x - y\right) \cdot z, \color{blue}{-6}, x\right) \]
            3. Applied rewrites99.8%

              \[\leadsto \color{blue}{\mathsf{fma}\left(\left(x - y\right) \cdot z, -6, x\right)} \]
            4. Taylor expanded in x around inf

              \[\leadsto \color{blue}{x \cdot \left(1 + -6 \cdot z\right)} \]
            5. Step-by-step derivation
              1. lower-*.f64N/A

                \[\leadsto x \cdot \color{blue}{\left(1 + -6 \cdot z\right)} \]
              2. lower-+.f64N/A

                \[\leadsto x \cdot \left(1 + \color{blue}{-6 \cdot z}\right) \]
              3. lower-*.f6460.6

                \[\leadsto x \cdot \left(1 + -6 \cdot \color{blue}{z}\right) \]
            6. Applied rewrites60.6%

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

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

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

                \[\leadsto \left(1 + -6 \cdot z\right) \cdot x \]
              4. +-commutativeN/A

                \[\leadsto \left(-6 \cdot z + 1\right) \cdot x \]
              5. distribute-lft1-inN/A

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

                \[\leadsto \left(-6 \cdot z\right) \cdot x + x \]
              7. lift-*.f64N/A

                \[\leadsto \left(-6 \cdot z\right) \cdot x + x \]
              8. *-rgt-identityN/A

                \[\leadsto \left(-6 \cdot z\right) \cdot \left(x \cdot 1\right) + x \]
              9. associate-*r*N/A

                \[\leadsto \left(\left(-6 \cdot z\right) \cdot x\right) \cdot 1 + x \]
              10. lift-*.f64N/A

                \[\leadsto \left(\left(-6 \cdot z\right) \cdot x\right) \cdot 1 + x \]
              11. metadata-evalN/A

                \[\leadsto \left(\left(-6 \cdot z\right) \cdot x\right) \cdot {y}^{0} + x \]
              12. metadata-evalN/A

                \[\leadsto \left(\left(-6 \cdot z\right) \cdot x\right) \cdot {y}^{\left(-1 + 1\right)} + x \]
              13. pow-plusN/A

                \[\leadsto \left(\left(-6 \cdot z\right) \cdot x\right) \cdot \left({y}^{-1} \cdot y\right) + x \]
              14. inv-powN/A

                \[\leadsto \left(\left(-6 \cdot z\right) \cdot x\right) \cdot \left(\frac{1}{y} \cdot y\right) + x \]
              15. associate-*l*N/A

                \[\leadsto \left(\left(\left(-6 \cdot z\right) \cdot x\right) \cdot \frac{1}{y}\right) \cdot y + x \]
              16. mult-flipN/A

                \[\leadsto \frac{\left(-6 \cdot z\right) \cdot x}{y} \cdot y + x \]
            8. Applied rewrites60.5%

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

            if -1.35e-140 < x < 8.19999999999999992e-82

            1. Initial program 99.7%

              \[x + \left(\left(y - x\right) \cdot 6\right) \cdot z \]
            2. Taylor expanded in x around 0

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

                \[\leadsto 6 \cdot \color{blue}{\left(y \cdot z\right)} \]
              2. lower-*.f6442.8

                \[\leadsto 6 \cdot \left(y \cdot \color{blue}{z}\right) \]
            4. Applied rewrites42.8%

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

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

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

                \[\leadsto 6 \cdot \left(z \cdot \color{blue}{y}\right) \]
              4. associate-*l*N/A

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

                \[\leadsto \left(6 \cdot z\right) \cdot \color{blue}{y} \]
              6. lower-*.f6442.8

                \[\leadsto \left(6 \cdot z\right) \cdot y \]
            6. Applied rewrites42.8%

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

          Alternative 8: 59.9% accurate, 0.6× speedup?

          \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -3.1 \cdot 10^{+116}:\\ \;\;\;\;\left(-6 \cdot x\right) \cdot z\\ \mathbf{elif}\;z \leq -1.52 \cdot 10^{-46}:\\ \;\;\;\;\left(6 \cdot y\right) \cdot z\\ \mathbf{elif}\;z \leq 1.15 \cdot 10^{-134}:\\ \;\;\;\;x \cdot 1\\ \mathbf{elif}\;z \leq 65:\\ \;\;\;\;6 \cdot \left(y \cdot z\right)\\ \mathbf{else}:\\ \;\;\;\;-6 \cdot \left(x \cdot z\right)\\ \end{array} \end{array} \]
          (FPCore (x y z)
           :precision binary64
           (if (<= z -3.1e+116)
             (* (* -6.0 x) z)
             (if (<= z -1.52e-46)
               (* (* 6.0 y) z)
               (if (<= z 1.15e-134)
                 (* x 1.0)
                 (if (<= z 65.0) (* 6.0 (* y z)) (* -6.0 (* x z)))))))
          double code(double x, double y, double z) {
          	double tmp;
          	if (z <= -3.1e+116) {
          		tmp = (-6.0 * x) * z;
          	} else if (z <= -1.52e-46) {
          		tmp = (6.0 * y) * z;
          	} else if (z <= 1.15e-134) {
          		tmp = x * 1.0;
          	} else if (z <= 65.0) {
          		tmp = 6.0 * (y * z);
          	} else {
          		tmp = -6.0 * (x * z);
          	}
          	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)
          use fmin_fmax_functions
              real(8), intent (in) :: x
              real(8), intent (in) :: y
              real(8), intent (in) :: z
              real(8) :: tmp
              if (z <= (-3.1d+116)) then
                  tmp = ((-6.0d0) * x) * z
              else if (z <= (-1.52d-46)) then
                  tmp = (6.0d0 * y) * z
              else if (z <= 1.15d-134) then
                  tmp = x * 1.0d0
              else if (z <= 65.0d0) then
                  tmp = 6.0d0 * (y * z)
              else
                  tmp = (-6.0d0) * (x * z)
              end if
              code = tmp
          end function
          
          public static double code(double x, double y, double z) {
          	double tmp;
          	if (z <= -3.1e+116) {
          		tmp = (-6.0 * x) * z;
          	} else if (z <= -1.52e-46) {
          		tmp = (6.0 * y) * z;
          	} else if (z <= 1.15e-134) {
          		tmp = x * 1.0;
          	} else if (z <= 65.0) {
          		tmp = 6.0 * (y * z);
          	} else {
          		tmp = -6.0 * (x * z);
          	}
          	return tmp;
          }
          
          def code(x, y, z):
          	tmp = 0
          	if z <= -3.1e+116:
          		tmp = (-6.0 * x) * z
          	elif z <= -1.52e-46:
          		tmp = (6.0 * y) * z
          	elif z <= 1.15e-134:
          		tmp = x * 1.0
          	elif z <= 65.0:
          		tmp = 6.0 * (y * z)
          	else:
          		tmp = -6.0 * (x * z)
          	return tmp
          
          function code(x, y, z)
          	tmp = 0.0
          	if (z <= -3.1e+116)
          		tmp = Float64(Float64(-6.0 * x) * z);
          	elseif (z <= -1.52e-46)
          		tmp = Float64(Float64(6.0 * y) * z);
          	elseif (z <= 1.15e-134)
          		tmp = Float64(x * 1.0);
          	elseif (z <= 65.0)
          		tmp = Float64(6.0 * Float64(y * z));
          	else
          		tmp = Float64(-6.0 * Float64(x * z));
          	end
          	return tmp
          end
          
          function tmp_2 = code(x, y, z)
          	tmp = 0.0;
          	if (z <= -3.1e+116)
          		tmp = (-6.0 * x) * z;
          	elseif (z <= -1.52e-46)
          		tmp = (6.0 * y) * z;
          	elseif (z <= 1.15e-134)
          		tmp = x * 1.0;
          	elseif (z <= 65.0)
          		tmp = 6.0 * (y * z);
          	else
          		tmp = -6.0 * (x * z);
          	end
          	tmp_2 = tmp;
          end
          
          code[x_, y_, z_] := If[LessEqual[z, -3.1e+116], N[(N[(-6.0 * x), $MachinePrecision] * z), $MachinePrecision], If[LessEqual[z, -1.52e-46], N[(N[(6.0 * y), $MachinePrecision] * z), $MachinePrecision], If[LessEqual[z, 1.15e-134], N[(x * 1.0), $MachinePrecision], If[LessEqual[z, 65.0], N[(6.0 * N[(y * z), $MachinePrecision]), $MachinePrecision], N[(-6.0 * N[(x * z), $MachinePrecision]), $MachinePrecision]]]]]
          
          \begin{array}{l}
          
          \\
          \begin{array}{l}
          \mathbf{if}\;z \leq -3.1 \cdot 10^{+116}:\\
          \;\;\;\;\left(-6 \cdot x\right) \cdot z\\
          
          \mathbf{elif}\;z \leq -1.52 \cdot 10^{-46}:\\
          \;\;\;\;\left(6 \cdot y\right) \cdot z\\
          
          \mathbf{elif}\;z \leq 1.15 \cdot 10^{-134}:\\
          \;\;\;\;x \cdot 1\\
          
          \mathbf{elif}\;z \leq 65:\\
          \;\;\;\;6 \cdot \left(y \cdot z\right)\\
          
          \mathbf{else}:\\
          \;\;\;\;-6 \cdot \left(x \cdot z\right)\\
          
          
          \end{array}
          \end{array}
          
          Derivation
          1. Split input into 5 regimes
          2. if z < -3.09999999999999996e116

            1. Initial program 99.7%

              \[x + \left(\left(y - x\right) \cdot 6\right) \cdot z \]
            2. Step-by-step derivation
              1. lift-+.f64N/A

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

                \[\leadsto \color{blue}{\left(\left(y - x\right) \cdot 6\right) \cdot z + x} \]
              3. add-flipN/A

                \[\leadsto \color{blue}{\left(\left(y - x\right) \cdot 6\right) \cdot z - \left(\mathsf{neg}\left(x\right)\right)} \]
              4. *-lft-identityN/A

                \[\leadsto \left(\left(y - x\right) \cdot 6\right) \cdot z - \color{blue}{1 \cdot \left(\mathsf{neg}\left(x\right)\right)} \]
              5. fp-cancel-sub-sign-invN/A

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

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

                \[\leadsto \color{blue}{\left(\left(y - x\right) \cdot 6\right)} \cdot z + \left(\mathsf{neg}\left(1\right)\right) \cdot \left(\mathsf{neg}\left(x\right)\right) \]
              8. associate-*l*N/A

                \[\leadsto \color{blue}{\left(y - x\right) \cdot \left(6 \cdot z\right)} + \left(\mathsf{neg}\left(1\right)\right) \cdot \left(\mathsf{neg}\left(x\right)\right) \]
              9. *-commutativeN/A

                \[\leadsto \left(y - x\right) \cdot \color{blue}{\left(z \cdot 6\right)} + \left(\mathsf{neg}\left(1\right)\right) \cdot \left(\mathsf{neg}\left(x\right)\right) \]
              10. associate-*r*N/A

                \[\leadsto \color{blue}{\left(\left(y - x\right) \cdot z\right) \cdot 6} + \left(\mathsf{neg}\left(1\right)\right) \cdot \left(\mathsf{neg}\left(x\right)\right) \]
              11. *-commutativeN/A

                \[\leadsto \color{blue}{\left(z \cdot \left(y - x\right)\right)} \cdot 6 + \left(\mathsf{neg}\left(1\right)\right) \cdot \left(\mathsf{neg}\left(x\right)\right) \]
              12. remove-double-negN/A

                \[\leadsto \left(z \cdot \left(y - x\right)\right) \cdot \color{blue}{\left(\mathsf{neg}\left(\left(\mathsf{neg}\left(6\right)\right)\right)\right)} + \left(\mathsf{neg}\left(1\right)\right) \cdot \left(\mathsf{neg}\left(x\right)\right) \]
              13. distribute-rgt-neg-outN/A

                \[\leadsto \color{blue}{\left(\mathsf{neg}\left(\left(z \cdot \left(y - x\right)\right) \cdot \left(\mathsf{neg}\left(6\right)\right)\right)\right)} + \left(\mathsf{neg}\left(1\right)\right) \cdot \left(\mathsf{neg}\left(x\right)\right) \]
              14. distribute-lft-neg-inN/A

                \[\leadsto \color{blue}{\left(\mathsf{neg}\left(z \cdot \left(y - x\right)\right)\right) \cdot \left(\mathsf{neg}\left(6\right)\right)} + \left(\mathsf{neg}\left(1\right)\right) \cdot \left(\mathsf{neg}\left(x\right)\right) \]
              15. distribute-lft-neg-outN/A

                \[\leadsto \left(\mathsf{neg}\left(z \cdot \left(y - x\right)\right)\right) \cdot \left(\mathsf{neg}\left(6\right)\right) + \color{blue}{\left(\mathsf{neg}\left(1 \cdot \left(\mathsf{neg}\left(x\right)\right)\right)\right)} \]
              16. *-lft-identityN/A

                \[\leadsto \left(\mathsf{neg}\left(z \cdot \left(y - x\right)\right)\right) \cdot \left(\mathsf{neg}\left(6\right)\right) + \left(\mathsf{neg}\left(\color{blue}{\left(\mathsf{neg}\left(x\right)\right)}\right)\right) \]
              17. remove-double-negN/A

                \[\leadsto \left(\mathsf{neg}\left(z \cdot \left(y - x\right)\right)\right) \cdot \left(\mathsf{neg}\left(6\right)\right) + \color{blue}{x} \]
              18. lower-fma.f64N/A

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

                \[\leadsto \mathsf{fma}\left(\mathsf{neg}\left(\color{blue}{\left(y - x\right) \cdot z}\right), \mathsf{neg}\left(6\right), x\right) \]
              20. distribute-lft-neg-outN/A

                \[\leadsto \mathsf{fma}\left(\color{blue}{\left(\mathsf{neg}\left(\left(y - x\right)\right)\right) \cdot z}, \mathsf{neg}\left(6\right), x\right) \]
              21. lift--.f64N/A

                \[\leadsto \mathsf{fma}\left(\left(\mathsf{neg}\left(\color{blue}{\left(y - x\right)}\right)\right) \cdot z, \mathsf{neg}\left(6\right), x\right) \]
              22. sub-negate-revN/A

                \[\leadsto \mathsf{fma}\left(\color{blue}{\left(x - y\right)} \cdot z, \mathsf{neg}\left(6\right), x\right) \]
              23. lower-*.f64N/A

                \[\leadsto \mathsf{fma}\left(\color{blue}{\left(x - y\right) \cdot z}, \mathsf{neg}\left(6\right), x\right) \]
              24. lower--.f64N/A

                \[\leadsto \mathsf{fma}\left(\color{blue}{\left(x - y\right)} \cdot z, \mathsf{neg}\left(6\right), x\right) \]
              25. metadata-eval99.8

                \[\leadsto \mathsf{fma}\left(\left(x - y\right) \cdot z, \color{blue}{-6}, x\right) \]
            3. Applied rewrites99.8%

              \[\leadsto \color{blue}{\mathsf{fma}\left(\left(x - y\right) \cdot z, -6, x\right)} \]
            4. Taylor expanded in z around inf

              \[\leadsto \color{blue}{-6 \cdot \left(z \cdot \left(x - y\right)\right)} \]
            5. Step-by-step derivation
              1. lower-*.f64N/A

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

                \[\leadsto -6 \cdot \left(z \cdot \color{blue}{\left(x - y\right)}\right) \]
              3. lower--.f6466.0

                \[\leadsto -6 \cdot \left(z \cdot \left(x - \color{blue}{y}\right)\right) \]
            6. Applied rewrites66.0%

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

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

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

                \[\leadsto -6 \cdot \left(z \cdot \left(x - \color{blue}{y}\right)\right) \]
              4. sub-negate-revN/A

                \[\leadsto -6 \cdot \left(z \cdot \left(\mathsf{neg}\left(\left(y - x\right)\right)\right)\right) \]
              5. distribute-rgt-neg-outN/A

                \[\leadsto -6 \cdot \left(\mathsf{neg}\left(z \cdot \left(y - x\right)\right)\right) \]
              6. distribute-rgt-neg-outN/A

                \[\leadsto \mathsf{neg}\left(-6 \cdot \left(z \cdot \left(y - x\right)\right)\right) \]
              7. distribute-lft-neg-outN/A

                \[\leadsto \left(\mathsf{neg}\left(-6\right)\right) \cdot \color{blue}{\left(z \cdot \left(y - x\right)\right)} \]
              8. metadata-evalN/A

                \[\leadsto 6 \cdot \left(\color{blue}{z} \cdot \left(y - x\right)\right) \]
              9. *-commutativeN/A

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

                \[\leadsto z \cdot \color{blue}{\left(\left(y - x\right) \cdot 6\right)} \]
              11. *-commutativeN/A

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

                \[\leadsto \left(\left(y - x\right) \cdot 6\right) \cdot \color{blue}{z} \]
              13. *-commutativeN/A

                \[\leadsto \left(6 \cdot \left(y - x\right)\right) \cdot z \]
              14. lower-*.f64N/A

                \[\leadsto \left(6 \cdot \left(y - x\right)\right) \cdot z \]
              15. lower--.f6466.0

                \[\leadsto \left(6 \cdot \left(y - x\right)\right) \cdot z \]
            8. Applied rewrites66.0%

              \[\leadsto \left(6 \cdot \left(y - x\right)\right) \cdot \color{blue}{z} \]
            9. Taylor expanded in x around inf

              \[\leadsto \left(-6 \cdot x\right) \cdot z \]
            10. Step-by-step derivation
              1. lower-*.f6427.6

                \[\leadsto \left(-6 \cdot x\right) \cdot z \]
            11. Applied rewrites27.6%

              \[\leadsto \left(-6 \cdot x\right) \cdot z \]

            if -3.09999999999999996e116 < z < -1.52000000000000006e-46

            1. Initial program 99.7%

              \[x + \left(\left(y - x\right) \cdot 6\right) \cdot z \]
            2. Taylor expanded in x around 0

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

                \[\leadsto 6 \cdot \color{blue}{\left(y \cdot z\right)} \]
              2. lower-*.f6442.8

                \[\leadsto 6 \cdot \left(y \cdot \color{blue}{z}\right) \]
            4. Applied rewrites42.8%

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

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

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

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

                \[\leadsto \left(6 \cdot y\right) \cdot \color{blue}{z} \]
              5. lower-*.f6442.8

                \[\leadsto \left(6 \cdot y\right) \cdot z \]
            6. Applied rewrites42.8%

              \[\leadsto \left(6 \cdot y\right) \cdot \color{blue}{z} \]

            if -1.52000000000000006e-46 < z < 1.15e-134

            1. Initial program 99.7%

              \[x + \left(\left(y - x\right) \cdot 6\right) \cdot z \]
            2. Step-by-step derivation
              1. lift-+.f64N/A

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

                \[\leadsto \color{blue}{\left(\left(y - x\right) \cdot 6\right) \cdot z + x} \]
              3. add-flipN/A

                \[\leadsto \color{blue}{\left(\left(y - x\right) \cdot 6\right) \cdot z - \left(\mathsf{neg}\left(x\right)\right)} \]
              4. *-lft-identityN/A

                \[\leadsto \left(\left(y - x\right) \cdot 6\right) \cdot z - \color{blue}{1 \cdot \left(\mathsf{neg}\left(x\right)\right)} \]
              5. fp-cancel-sub-sign-invN/A

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

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

                \[\leadsto \color{blue}{\left(\left(y - x\right) \cdot 6\right)} \cdot z + \left(\mathsf{neg}\left(1\right)\right) \cdot \left(\mathsf{neg}\left(x\right)\right) \]
              8. associate-*l*N/A

                \[\leadsto \color{blue}{\left(y - x\right) \cdot \left(6 \cdot z\right)} + \left(\mathsf{neg}\left(1\right)\right) \cdot \left(\mathsf{neg}\left(x\right)\right) \]
              9. *-commutativeN/A

                \[\leadsto \left(y - x\right) \cdot \color{blue}{\left(z \cdot 6\right)} + \left(\mathsf{neg}\left(1\right)\right) \cdot \left(\mathsf{neg}\left(x\right)\right) \]
              10. associate-*r*N/A

                \[\leadsto \color{blue}{\left(\left(y - x\right) \cdot z\right) \cdot 6} + \left(\mathsf{neg}\left(1\right)\right) \cdot \left(\mathsf{neg}\left(x\right)\right) \]
              11. *-commutativeN/A

                \[\leadsto \color{blue}{\left(z \cdot \left(y - x\right)\right)} \cdot 6 + \left(\mathsf{neg}\left(1\right)\right) \cdot \left(\mathsf{neg}\left(x\right)\right) \]
              12. remove-double-negN/A

                \[\leadsto \left(z \cdot \left(y - x\right)\right) \cdot \color{blue}{\left(\mathsf{neg}\left(\left(\mathsf{neg}\left(6\right)\right)\right)\right)} + \left(\mathsf{neg}\left(1\right)\right) \cdot \left(\mathsf{neg}\left(x\right)\right) \]
              13. distribute-rgt-neg-outN/A

                \[\leadsto \color{blue}{\left(\mathsf{neg}\left(\left(z \cdot \left(y - x\right)\right) \cdot \left(\mathsf{neg}\left(6\right)\right)\right)\right)} + \left(\mathsf{neg}\left(1\right)\right) \cdot \left(\mathsf{neg}\left(x\right)\right) \]
              14. distribute-lft-neg-inN/A

                \[\leadsto \color{blue}{\left(\mathsf{neg}\left(z \cdot \left(y - x\right)\right)\right) \cdot \left(\mathsf{neg}\left(6\right)\right)} + \left(\mathsf{neg}\left(1\right)\right) \cdot \left(\mathsf{neg}\left(x\right)\right) \]
              15. distribute-lft-neg-outN/A

                \[\leadsto \left(\mathsf{neg}\left(z \cdot \left(y - x\right)\right)\right) \cdot \left(\mathsf{neg}\left(6\right)\right) + \color{blue}{\left(\mathsf{neg}\left(1 \cdot \left(\mathsf{neg}\left(x\right)\right)\right)\right)} \]
              16. *-lft-identityN/A

                \[\leadsto \left(\mathsf{neg}\left(z \cdot \left(y - x\right)\right)\right) \cdot \left(\mathsf{neg}\left(6\right)\right) + \left(\mathsf{neg}\left(\color{blue}{\left(\mathsf{neg}\left(x\right)\right)}\right)\right) \]
              17. remove-double-negN/A

                \[\leadsto \left(\mathsf{neg}\left(z \cdot \left(y - x\right)\right)\right) \cdot \left(\mathsf{neg}\left(6\right)\right) + \color{blue}{x} \]
              18. lower-fma.f64N/A

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

                \[\leadsto \mathsf{fma}\left(\mathsf{neg}\left(\color{blue}{\left(y - x\right) \cdot z}\right), \mathsf{neg}\left(6\right), x\right) \]
              20. distribute-lft-neg-outN/A

                \[\leadsto \mathsf{fma}\left(\color{blue}{\left(\mathsf{neg}\left(\left(y - x\right)\right)\right) \cdot z}, \mathsf{neg}\left(6\right), x\right) \]
              21. lift--.f64N/A

                \[\leadsto \mathsf{fma}\left(\left(\mathsf{neg}\left(\color{blue}{\left(y - x\right)}\right)\right) \cdot z, \mathsf{neg}\left(6\right), x\right) \]
              22. sub-negate-revN/A

                \[\leadsto \mathsf{fma}\left(\color{blue}{\left(x - y\right)} \cdot z, \mathsf{neg}\left(6\right), x\right) \]
              23. lower-*.f64N/A

                \[\leadsto \mathsf{fma}\left(\color{blue}{\left(x - y\right) \cdot z}, \mathsf{neg}\left(6\right), x\right) \]
              24. lower--.f64N/A

                \[\leadsto \mathsf{fma}\left(\color{blue}{\left(x - y\right)} \cdot z, \mathsf{neg}\left(6\right), x\right) \]
              25. metadata-eval99.8

                \[\leadsto \mathsf{fma}\left(\left(x - y\right) \cdot z, \color{blue}{-6}, x\right) \]
            3. Applied rewrites99.8%

              \[\leadsto \color{blue}{\mathsf{fma}\left(\left(x - y\right) \cdot z, -6, x\right)} \]
            4. Taylor expanded in x around inf

              \[\leadsto \color{blue}{x \cdot \left(1 + -6 \cdot z\right)} \]
            5. Step-by-step derivation
              1. lower-*.f64N/A

                \[\leadsto x \cdot \color{blue}{\left(1 + -6 \cdot z\right)} \]
              2. lower-+.f64N/A

                \[\leadsto x \cdot \left(1 + \color{blue}{-6 \cdot z}\right) \]
              3. lower-*.f6460.6

                \[\leadsto x \cdot \left(1 + -6 \cdot \color{blue}{z}\right) \]
            6. Applied rewrites60.6%

              \[\leadsto \color{blue}{x \cdot \left(1 + -6 \cdot z\right)} \]
            7. Taylor expanded in z around 0

              \[\leadsto x \cdot 1 \]
            8. Step-by-step derivation
              1. Applied rewrites35.4%

                \[\leadsto x \cdot 1 \]

              if 1.15e-134 < z < 65

              1. Initial program 99.7%

                \[x + \left(\left(y - x\right) \cdot 6\right) \cdot z \]
              2. Taylor expanded in x around 0

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

                  \[\leadsto 6 \cdot \color{blue}{\left(y \cdot z\right)} \]
                2. lower-*.f6442.8

                  \[\leadsto 6 \cdot \left(y \cdot \color{blue}{z}\right) \]
              4. Applied rewrites42.8%

                \[\leadsto \color{blue}{6 \cdot \left(y \cdot z\right)} \]

              if 65 < z

              1. Initial program 99.7%

                \[x + \left(\left(y - x\right) \cdot 6\right) \cdot z \]
              2. Step-by-step derivation
                1. lift-+.f64N/A

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

                  \[\leadsto \color{blue}{\left(\left(y - x\right) \cdot 6\right) \cdot z + x} \]
                3. add-flipN/A

                  \[\leadsto \color{blue}{\left(\left(y - x\right) \cdot 6\right) \cdot z - \left(\mathsf{neg}\left(x\right)\right)} \]
                4. *-lft-identityN/A

                  \[\leadsto \left(\left(y - x\right) \cdot 6\right) \cdot z - \color{blue}{1 \cdot \left(\mathsf{neg}\left(x\right)\right)} \]
                5. fp-cancel-sub-sign-invN/A

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

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

                  \[\leadsto \color{blue}{\left(\left(y - x\right) \cdot 6\right)} \cdot z + \left(\mathsf{neg}\left(1\right)\right) \cdot \left(\mathsf{neg}\left(x\right)\right) \]
                8. associate-*l*N/A

                  \[\leadsto \color{blue}{\left(y - x\right) \cdot \left(6 \cdot z\right)} + \left(\mathsf{neg}\left(1\right)\right) \cdot \left(\mathsf{neg}\left(x\right)\right) \]
                9. *-commutativeN/A

                  \[\leadsto \left(y - x\right) \cdot \color{blue}{\left(z \cdot 6\right)} + \left(\mathsf{neg}\left(1\right)\right) \cdot \left(\mathsf{neg}\left(x\right)\right) \]
                10. associate-*r*N/A

                  \[\leadsto \color{blue}{\left(\left(y - x\right) \cdot z\right) \cdot 6} + \left(\mathsf{neg}\left(1\right)\right) \cdot \left(\mathsf{neg}\left(x\right)\right) \]
                11. *-commutativeN/A

                  \[\leadsto \color{blue}{\left(z \cdot \left(y - x\right)\right)} \cdot 6 + \left(\mathsf{neg}\left(1\right)\right) \cdot \left(\mathsf{neg}\left(x\right)\right) \]
                12. remove-double-negN/A

                  \[\leadsto \left(z \cdot \left(y - x\right)\right) \cdot \color{blue}{\left(\mathsf{neg}\left(\left(\mathsf{neg}\left(6\right)\right)\right)\right)} + \left(\mathsf{neg}\left(1\right)\right) \cdot \left(\mathsf{neg}\left(x\right)\right) \]
                13. distribute-rgt-neg-outN/A

                  \[\leadsto \color{blue}{\left(\mathsf{neg}\left(\left(z \cdot \left(y - x\right)\right) \cdot \left(\mathsf{neg}\left(6\right)\right)\right)\right)} + \left(\mathsf{neg}\left(1\right)\right) \cdot \left(\mathsf{neg}\left(x\right)\right) \]
                14. distribute-lft-neg-inN/A

                  \[\leadsto \color{blue}{\left(\mathsf{neg}\left(z \cdot \left(y - x\right)\right)\right) \cdot \left(\mathsf{neg}\left(6\right)\right)} + \left(\mathsf{neg}\left(1\right)\right) \cdot \left(\mathsf{neg}\left(x\right)\right) \]
                15. distribute-lft-neg-outN/A

                  \[\leadsto \left(\mathsf{neg}\left(z \cdot \left(y - x\right)\right)\right) \cdot \left(\mathsf{neg}\left(6\right)\right) + \color{blue}{\left(\mathsf{neg}\left(1 \cdot \left(\mathsf{neg}\left(x\right)\right)\right)\right)} \]
                16. *-lft-identityN/A

                  \[\leadsto \left(\mathsf{neg}\left(z \cdot \left(y - x\right)\right)\right) \cdot \left(\mathsf{neg}\left(6\right)\right) + \left(\mathsf{neg}\left(\color{blue}{\left(\mathsf{neg}\left(x\right)\right)}\right)\right) \]
                17. remove-double-negN/A

                  \[\leadsto \left(\mathsf{neg}\left(z \cdot \left(y - x\right)\right)\right) \cdot \left(\mathsf{neg}\left(6\right)\right) + \color{blue}{x} \]
                18. lower-fma.f64N/A

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

                  \[\leadsto \mathsf{fma}\left(\mathsf{neg}\left(\color{blue}{\left(y - x\right) \cdot z}\right), \mathsf{neg}\left(6\right), x\right) \]
                20. distribute-lft-neg-outN/A

                  \[\leadsto \mathsf{fma}\left(\color{blue}{\left(\mathsf{neg}\left(\left(y - x\right)\right)\right) \cdot z}, \mathsf{neg}\left(6\right), x\right) \]
                21. lift--.f64N/A

                  \[\leadsto \mathsf{fma}\left(\left(\mathsf{neg}\left(\color{blue}{\left(y - x\right)}\right)\right) \cdot z, \mathsf{neg}\left(6\right), x\right) \]
                22. sub-negate-revN/A

                  \[\leadsto \mathsf{fma}\left(\color{blue}{\left(x - y\right)} \cdot z, \mathsf{neg}\left(6\right), x\right) \]
                23. lower-*.f64N/A

                  \[\leadsto \mathsf{fma}\left(\color{blue}{\left(x - y\right) \cdot z}, \mathsf{neg}\left(6\right), x\right) \]
                24. lower--.f64N/A

                  \[\leadsto \mathsf{fma}\left(\color{blue}{\left(x - y\right)} \cdot z, \mathsf{neg}\left(6\right), x\right) \]
                25. metadata-eval99.8

                  \[\leadsto \mathsf{fma}\left(\left(x - y\right) \cdot z, \color{blue}{-6}, x\right) \]
              3. Applied rewrites99.8%

                \[\leadsto \color{blue}{\mathsf{fma}\left(\left(x - y\right) \cdot z, -6, x\right)} \]
              4. Taylor expanded in z around inf

                \[\leadsto \color{blue}{-6 \cdot \left(z \cdot \left(x - y\right)\right)} \]
              5. Step-by-step derivation
                1. lower-*.f64N/A

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

                  \[\leadsto -6 \cdot \left(z \cdot \color{blue}{\left(x - y\right)}\right) \]
                3. lower--.f6466.0

                  \[\leadsto -6 \cdot \left(z \cdot \left(x - \color{blue}{y}\right)\right) \]
              6. Applied rewrites66.0%

                \[\leadsto \color{blue}{-6 \cdot \left(z \cdot \left(x - y\right)\right)} \]
              7. Taylor expanded in x around inf

                \[\leadsto -6 \cdot \left(x \cdot \color{blue}{z}\right) \]
              8. Step-by-step derivation
                1. lower-*.f6427.6

                  \[\leadsto -6 \cdot \left(x \cdot z\right) \]
              9. Applied rewrites27.6%

                \[\leadsto -6 \cdot \left(x \cdot \color{blue}{z}\right) \]
            9. Recombined 5 regimes into one program.
            10. Add Preprocessing

            Alternative 9: 59.9% accurate, 0.6× speedup?

            \[\begin{array}{l} \\ \begin{array}{l} t_0 := -6 \cdot \left(x \cdot z\right)\\ \mathbf{if}\;z \leq -3.1 \cdot 10^{+116}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;z \leq -1.52 \cdot 10^{-46}:\\ \;\;\;\;\left(6 \cdot y\right) \cdot z\\ \mathbf{elif}\;z \leq 1.15 \cdot 10^{-134}:\\ \;\;\;\;x \cdot 1\\ \mathbf{elif}\;z \leq 65:\\ \;\;\;\;6 \cdot \left(y \cdot z\right)\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
            (FPCore (x y z)
             :precision binary64
             (let* ((t_0 (* -6.0 (* x z))))
               (if (<= z -3.1e+116)
                 t_0
                 (if (<= z -1.52e-46)
                   (* (* 6.0 y) z)
                   (if (<= z 1.15e-134) (* x 1.0) (if (<= z 65.0) (* 6.0 (* y z)) t_0))))))
            double code(double x, double y, double z) {
            	double t_0 = -6.0 * (x * z);
            	double tmp;
            	if (z <= -3.1e+116) {
            		tmp = t_0;
            	} else if (z <= -1.52e-46) {
            		tmp = (6.0 * y) * z;
            	} else if (z <= 1.15e-134) {
            		tmp = x * 1.0;
            	} else if (z <= 65.0) {
            		tmp = 6.0 * (y * z);
            	} else {
            		tmp = t_0;
            	}
            	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)
            use fmin_fmax_functions
                real(8), intent (in) :: x
                real(8), intent (in) :: y
                real(8), intent (in) :: z
                real(8) :: t_0
                real(8) :: tmp
                t_0 = (-6.0d0) * (x * z)
                if (z <= (-3.1d+116)) then
                    tmp = t_0
                else if (z <= (-1.52d-46)) then
                    tmp = (6.0d0 * y) * z
                else if (z <= 1.15d-134) then
                    tmp = x * 1.0d0
                else if (z <= 65.0d0) then
                    tmp = 6.0d0 * (y * z)
                else
                    tmp = t_0
                end if
                code = tmp
            end function
            
            public static double code(double x, double y, double z) {
            	double t_0 = -6.0 * (x * z);
            	double tmp;
            	if (z <= -3.1e+116) {
            		tmp = t_0;
            	} else if (z <= -1.52e-46) {
            		tmp = (6.0 * y) * z;
            	} else if (z <= 1.15e-134) {
            		tmp = x * 1.0;
            	} else if (z <= 65.0) {
            		tmp = 6.0 * (y * z);
            	} else {
            		tmp = t_0;
            	}
            	return tmp;
            }
            
            def code(x, y, z):
            	t_0 = -6.0 * (x * z)
            	tmp = 0
            	if z <= -3.1e+116:
            		tmp = t_0
            	elif z <= -1.52e-46:
            		tmp = (6.0 * y) * z
            	elif z <= 1.15e-134:
            		tmp = x * 1.0
            	elif z <= 65.0:
            		tmp = 6.0 * (y * z)
            	else:
            		tmp = t_0
            	return tmp
            
            function code(x, y, z)
            	t_0 = Float64(-6.0 * Float64(x * z))
            	tmp = 0.0
            	if (z <= -3.1e+116)
            		tmp = t_0;
            	elseif (z <= -1.52e-46)
            		tmp = Float64(Float64(6.0 * y) * z);
            	elseif (z <= 1.15e-134)
            		tmp = Float64(x * 1.0);
            	elseif (z <= 65.0)
            		tmp = Float64(6.0 * Float64(y * z));
            	else
            		tmp = t_0;
            	end
            	return tmp
            end
            
            function tmp_2 = code(x, y, z)
            	t_0 = -6.0 * (x * z);
            	tmp = 0.0;
            	if (z <= -3.1e+116)
            		tmp = t_0;
            	elseif (z <= -1.52e-46)
            		tmp = (6.0 * y) * z;
            	elseif (z <= 1.15e-134)
            		tmp = x * 1.0;
            	elseif (z <= 65.0)
            		tmp = 6.0 * (y * z);
            	else
            		tmp = t_0;
            	end
            	tmp_2 = tmp;
            end
            
            code[x_, y_, z_] := Block[{t$95$0 = N[(-6.0 * N[(x * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -3.1e+116], t$95$0, If[LessEqual[z, -1.52e-46], N[(N[(6.0 * y), $MachinePrecision] * z), $MachinePrecision], If[LessEqual[z, 1.15e-134], N[(x * 1.0), $MachinePrecision], If[LessEqual[z, 65.0], N[(6.0 * N[(y * z), $MachinePrecision]), $MachinePrecision], t$95$0]]]]]
            
            \begin{array}{l}
            
            \\
            \begin{array}{l}
            t_0 := -6 \cdot \left(x \cdot z\right)\\
            \mathbf{if}\;z \leq -3.1 \cdot 10^{+116}:\\
            \;\;\;\;t\_0\\
            
            \mathbf{elif}\;z \leq -1.52 \cdot 10^{-46}:\\
            \;\;\;\;\left(6 \cdot y\right) \cdot z\\
            
            \mathbf{elif}\;z \leq 1.15 \cdot 10^{-134}:\\
            \;\;\;\;x \cdot 1\\
            
            \mathbf{elif}\;z \leq 65:\\
            \;\;\;\;6 \cdot \left(y \cdot z\right)\\
            
            \mathbf{else}:\\
            \;\;\;\;t\_0\\
            
            
            \end{array}
            \end{array}
            
            Derivation
            1. Split input into 4 regimes
            2. if z < -3.09999999999999996e116 or 65 < z

              1. Initial program 99.7%

                \[x + \left(\left(y - x\right) \cdot 6\right) \cdot z \]
              2. Step-by-step derivation
                1. lift-+.f64N/A

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

                  \[\leadsto \color{blue}{\left(\left(y - x\right) \cdot 6\right) \cdot z + x} \]
                3. add-flipN/A

                  \[\leadsto \color{blue}{\left(\left(y - x\right) \cdot 6\right) \cdot z - \left(\mathsf{neg}\left(x\right)\right)} \]
                4. *-lft-identityN/A

                  \[\leadsto \left(\left(y - x\right) \cdot 6\right) \cdot z - \color{blue}{1 \cdot \left(\mathsf{neg}\left(x\right)\right)} \]
                5. fp-cancel-sub-sign-invN/A

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

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

                  \[\leadsto \color{blue}{\left(\left(y - x\right) \cdot 6\right)} \cdot z + \left(\mathsf{neg}\left(1\right)\right) \cdot \left(\mathsf{neg}\left(x\right)\right) \]
                8. associate-*l*N/A

                  \[\leadsto \color{blue}{\left(y - x\right) \cdot \left(6 \cdot z\right)} + \left(\mathsf{neg}\left(1\right)\right) \cdot \left(\mathsf{neg}\left(x\right)\right) \]
                9. *-commutativeN/A

                  \[\leadsto \left(y - x\right) \cdot \color{blue}{\left(z \cdot 6\right)} + \left(\mathsf{neg}\left(1\right)\right) \cdot \left(\mathsf{neg}\left(x\right)\right) \]
                10. associate-*r*N/A

                  \[\leadsto \color{blue}{\left(\left(y - x\right) \cdot z\right) \cdot 6} + \left(\mathsf{neg}\left(1\right)\right) \cdot \left(\mathsf{neg}\left(x\right)\right) \]
                11. *-commutativeN/A

                  \[\leadsto \color{blue}{\left(z \cdot \left(y - x\right)\right)} \cdot 6 + \left(\mathsf{neg}\left(1\right)\right) \cdot \left(\mathsf{neg}\left(x\right)\right) \]
                12. remove-double-negN/A

                  \[\leadsto \left(z \cdot \left(y - x\right)\right) \cdot \color{blue}{\left(\mathsf{neg}\left(\left(\mathsf{neg}\left(6\right)\right)\right)\right)} + \left(\mathsf{neg}\left(1\right)\right) \cdot \left(\mathsf{neg}\left(x\right)\right) \]
                13. distribute-rgt-neg-outN/A

                  \[\leadsto \color{blue}{\left(\mathsf{neg}\left(\left(z \cdot \left(y - x\right)\right) \cdot \left(\mathsf{neg}\left(6\right)\right)\right)\right)} + \left(\mathsf{neg}\left(1\right)\right) \cdot \left(\mathsf{neg}\left(x\right)\right) \]
                14. distribute-lft-neg-inN/A

                  \[\leadsto \color{blue}{\left(\mathsf{neg}\left(z \cdot \left(y - x\right)\right)\right) \cdot \left(\mathsf{neg}\left(6\right)\right)} + \left(\mathsf{neg}\left(1\right)\right) \cdot \left(\mathsf{neg}\left(x\right)\right) \]
                15. distribute-lft-neg-outN/A

                  \[\leadsto \left(\mathsf{neg}\left(z \cdot \left(y - x\right)\right)\right) \cdot \left(\mathsf{neg}\left(6\right)\right) + \color{blue}{\left(\mathsf{neg}\left(1 \cdot \left(\mathsf{neg}\left(x\right)\right)\right)\right)} \]
                16. *-lft-identityN/A

                  \[\leadsto \left(\mathsf{neg}\left(z \cdot \left(y - x\right)\right)\right) \cdot \left(\mathsf{neg}\left(6\right)\right) + \left(\mathsf{neg}\left(\color{blue}{\left(\mathsf{neg}\left(x\right)\right)}\right)\right) \]
                17. remove-double-negN/A

                  \[\leadsto \left(\mathsf{neg}\left(z \cdot \left(y - x\right)\right)\right) \cdot \left(\mathsf{neg}\left(6\right)\right) + \color{blue}{x} \]
                18. lower-fma.f64N/A

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

                  \[\leadsto \mathsf{fma}\left(\mathsf{neg}\left(\color{blue}{\left(y - x\right) \cdot z}\right), \mathsf{neg}\left(6\right), x\right) \]
                20. distribute-lft-neg-outN/A

                  \[\leadsto \mathsf{fma}\left(\color{blue}{\left(\mathsf{neg}\left(\left(y - x\right)\right)\right) \cdot z}, \mathsf{neg}\left(6\right), x\right) \]
                21. lift--.f64N/A

                  \[\leadsto \mathsf{fma}\left(\left(\mathsf{neg}\left(\color{blue}{\left(y - x\right)}\right)\right) \cdot z, \mathsf{neg}\left(6\right), x\right) \]
                22. sub-negate-revN/A

                  \[\leadsto \mathsf{fma}\left(\color{blue}{\left(x - y\right)} \cdot z, \mathsf{neg}\left(6\right), x\right) \]
                23. lower-*.f64N/A

                  \[\leadsto \mathsf{fma}\left(\color{blue}{\left(x - y\right) \cdot z}, \mathsf{neg}\left(6\right), x\right) \]
                24. lower--.f64N/A

                  \[\leadsto \mathsf{fma}\left(\color{blue}{\left(x - y\right)} \cdot z, \mathsf{neg}\left(6\right), x\right) \]
                25. metadata-eval99.8

                  \[\leadsto \mathsf{fma}\left(\left(x - y\right) \cdot z, \color{blue}{-6}, x\right) \]
              3. Applied rewrites99.8%

                \[\leadsto \color{blue}{\mathsf{fma}\left(\left(x - y\right) \cdot z, -6, x\right)} \]
              4. Taylor expanded in z around inf

                \[\leadsto \color{blue}{-6 \cdot \left(z \cdot \left(x - y\right)\right)} \]
              5. Step-by-step derivation
                1. lower-*.f64N/A

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

                  \[\leadsto -6 \cdot \left(z \cdot \color{blue}{\left(x - y\right)}\right) \]
                3. lower--.f6466.0

                  \[\leadsto -6 \cdot \left(z \cdot \left(x - \color{blue}{y}\right)\right) \]
              6. Applied rewrites66.0%

                \[\leadsto \color{blue}{-6 \cdot \left(z \cdot \left(x - y\right)\right)} \]
              7. Taylor expanded in x around inf

                \[\leadsto -6 \cdot \left(x \cdot \color{blue}{z}\right) \]
              8. Step-by-step derivation
                1. lower-*.f6427.6

                  \[\leadsto -6 \cdot \left(x \cdot z\right) \]
              9. Applied rewrites27.6%

                \[\leadsto -6 \cdot \left(x \cdot \color{blue}{z}\right) \]

              if -3.09999999999999996e116 < z < -1.52000000000000006e-46

              1. Initial program 99.7%

                \[x + \left(\left(y - x\right) \cdot 6\right) \cdot z \]
              2. Taylor expanded in x around 0

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

                  \[\leadsto 6 \cdot \color{blue}{\left(y \cdot z\right)} \]
                2. lower-*.f6442.8

                  \[\leadsto 6 \cdot \left(y \cdot \color{blue}{z}\right) \]
              4. Applied rewrites42.8%

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

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

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

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

                  \[\leadsto \left(6 \cdot y\right) \cdot \color{blue}{z} \]
                5. lower-*.f6442.8

                  \[\leadsto \left(6 \cdot y\right) \cdot z \]
              6. Applied rewrites42.8%

                \[\leadsto \left(6 \cdot y\right) \cdot \color{blue}{z} \]

              if -1.52000000000000006e-46 < z < 1.15e-134

              1. Initial program 99.7%

                \[x + \left(\left(y - x\right) \cdot 6\right) \cdot z \]
              2. Step-by-step derivation
                1. lift-+.f64N/A

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

                  \[\leadsto \color{blue}{\left(\left(y - x\right) \cdot 6\right) \cdot z + x} \]
                3. add-flipN/A

                  \[\leadsto \color{blue}{\left(\left(y - x\right) \cdot 6\right) \cdot z - \left(\mathsf{neg}\left(x\right)\right)} \]
                4. *-lft-identityN/A

                  \[\leadsto \left(\left(y - x\right) \cdot 6\right) \cdot z - \color{blue}{1 \cdot \left(\mathsf{neg}\left(x\right)\right)} \]
                5. fp-cancel-sub-sign-invN/A

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

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

                  \[\leadsto \color{blue}{\left(\left(y - x\right) \cdot 6\right)} \cdot z + \left(\mathsf{neg}\left(1\right)\right) \cdot \left(\mathsf{neg}\left(x\right)\right) \]
                8. associate-*l*N/A

                  \[\leadsto \color{blue}{\left(y - x\right) \cdot \left(6 \cdot z\right)} + \left(\mathsf{neg}\left(1\right)\right) \cdot \left(\mathsf{neg}\left(x\right)\right) \]
                9. *-commutativeN/A

                  \[\leadsto \left(y - x\right) \cdot \color{blue}{\left(z \cdot 6\right)} + \left(\mathsf{neg}\left(1\right)\right) \cdot \left(\mathsf{neg}\left(x\right)\right) \]
                10. associate-*r*N/A

                  \[\leadsto \color{blue}{\left(\left(y - x\right) \cdot z\right) \cdot 6} + \left(\mathsf{neg}\left(1\right)\right) \cdot \left(\mathsf{neg}\left(x\right)\right) \]
                11. *-commutativeN/A

                  \[\leadsto \color{blue}{\left(z \cdot \left(y - x\right)\right)} \cdot 6 + \left(\mathsf{neg}\left(1\right)\right) \cdot \left(\mathsf{neg}\left(x\right)\right) \]
                12. remove-double-negN/A

                  \[\leadsto \left(z \cdot \left(y - x\right)\right) \cdot \color{blue}{\left(\mathsf{neg}\left(\left(\mathsf{neg}\left(6\right)\right)\right)\right)} + \left(\mathsf{neg}\left(1\right)\right) \cdot \left(\mathsf{neg}\left(x\right)\right) \]
                13. distribute-rgt-neg-outN/A

                  \[\leadsto \color{blue}{\left(\mathsf{neg}\left(\left(z \cdot \left(y - x\right)\right) \cdot \left(\mathsf{neg}\left(6\right)\right)\right)\right)} + \left(\mathsf{neg}\left(1\right)\right) \cdot \left(\mathsf{neg}\left(x\right)\right) \]
                14. distribute-lft-neg-inN/A

                  \[\leadsto \color{blue}{\left(\mathsf{neg}\left(z \cdot \left(y - x\right)\right)\right) \cdot \left(\mathsf{neg}\left(6\right)\right)} + \left(\mathsf{neg}\left(1\right)\right) \cdot \left(\mathsf{neg}\left(x\right)\right) \]
                15. distribute-lft-neg-outN/A

                  \[\leadsto \left(\mathsf{neg}\left(z \cdot \left(y - x\right)\right)\right) \cdot \left(\mathsf{neg}\left(6\right)\right) + \color{blue}{\left(\mathsf{neg}\left(1 \cdot \left(\mathsf{neg}\left(x\right)\right)\right)\right)} \]
                16. *-lft-identityN/A

                  \[\leadsto \left(\mathsf{neg}\left(z \cdot \left(y - x\right)\right)\right) \cdot \left(\mathsf{neg}\left(6\right)\right) + \left(\mathsf{neg}\left(\color{blue}{\left(\mathsf{neg}\left(x\right)\right)}\right)\right) \]
                17. remove-double-negN/A

                  \[\leadsto \left(\mathsf{neg}\left(z \cdot \left(y - x\right)\right)\right) \cdot \left(\mathsf{neg}\left(6\right)\right) + \color{blue}{x} \]
                18. lower-fma.f64N/A

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

                  \[\leadsto \mathsf{fma}\left(\mathsf{neg}\left(\color{blue}{\left(y - x\right) \cdot z}\right), \mathsf{neg}\left(6\right), x\right) \]
                20. distribute-lft-neg-outN/A

                  \[\leadsto \mathsf{fma}\left(\color{blue}{\left(\mathsf{neg}\left(\left(y - x\right)\right)\right) \cdot z}, \mathsf{neg}\left(6\right), x\right) \]
                21. lift--.f64N/A

                  \[\leadsto \mathsf{fma}\left(\left(\mathsf{neg}\left(\color{blue}{\left(y - x\right)}\right)\right) \cdot z, \mathsf{neg}\left(6\right), x\right) \]
                22. sub-negate-revN/A

                  \[\leadsto \mathsf{fma}\left(\color{blue}{\left(x - y\right)} \cdot z, \mathsf{neg}\left(6\right), x\right) \]
                23. lower-*.f64N/A

                  \[\leadsto \mathsf{fma}\left(\color{blue}{\left(x - y\right) \cdot z}, \mathsf{neg}\left(6\right), x\right) \]
                24. lower--.f64N/A

                  \[\leadsto \mathsf{fma}\left(\color{blue}{\left(x - y\right)} \cdot z, \mathsf{neg}\left(6\right), x\right) \]
                25. metadata-eval99.8

                  \[\leadsto \mathsf{fma}\left(\left(x - y\right) \cdot z, \color{blue}{-6}, x\right) \]
              3. Applied rewrites99.8%

                \[\leadsto \color{blue}{\mathsf{fma}\left(\left(x - y\right) \cdot z, -6, x\right)} \]
              4. Taylor expanded in x around inf

                \[\leadsto \color{blue}{x \cdot \left(1 + -6 \cdot z\right)} \]
              5. Step-by-step derivation
                1. lower-*.f64N/A

                  \[\leadsto x \cdot \color{blue}{\left(1 + -6 \cdot z\right)} \]
                2. lower-+.f64N/A

                  \[\leadsto x \cdot \left(1 + \color{blue}{-6 \cdot z}\right) \]
                3. lower-*.f6460.6

                  \[\leadsto x \cdot \left(1 + -6 \cdot \color{blue}{z}\right) \]
              6. Applied rewrites60.6%

                \[\leadsto \color{blue}{x \cdot \left(1 + -6 \cdot z\right)} \]
              7. Taylor expanded in z around 0

                \[\leadsto x \cdot 1 \]
              8. Step-by-step derivation
                1. Applied rewrites35.4%

                  \[\leadsto x \cdot 1 \]

                if 1.15e-134 < z < 65

                1. Initial program 99.7%

                  \[x + \left(\left(y - x\right) \cdot 6\right) \cdot z \]
                2. Taylor expanded in x around 0

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

                    \[\leadsto 6 \cdot \color{blue}{\left(y \cdot z\right)} \]
                  2. lower-*.f6442.8

                    \[\leadsto 6 \cdot \left(y \cdot \color{blue}{z}\right) \]
                4. Applied rewrites42.8%

                  \[\leadsto \color{blue}{6 \cdot \left(y \cdot z\right)} \]
              9. Recombined 4 regimes into one program.
              10. Add Preprocessing

              Alternative 10: 59.3% accurate, 0.8× speedup?

              \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -1.52 \cdot 10^{-46}:\\ \;\;\;\;\left(6 \cdot y\right) \cdot z\\ \mathbf{elif}\;z \leq 1.15 \cdot 10^{-134}:\\ \;\;\;\;x \cdot 1\\ \mathbf{else}:\\ \;\;\;\;6 \cdot \left(y \cdot z\right)\\ \end{array} \end{array} \]
              (FPCore (x y z)
               :precision binary64
               (if (<= z -1.52e-46)
                 (* (* 6.0 y) z)
                 (if (<= z 1.15e-134) (* x 1.0) (* 6.0 (* y z)))))
              double code(double x, double y, double z) {
              	double tmp;
              	if (z <= -1.52e-46) {
              		tmp = (6.0 * y) * z;
              	} else if (z <= 1.15e-134) {
              		tmp = x * 1.0;
              	} else {
              		tmp = 6.0 * (y * z);
              	}
              	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)
              use fmin_fmax_functions
                  real(8), intent (in) :: x
                  real(8), intent (in) :: y
                  real(8), intent (in) :: z
                  real(8) :: tmp
                  if (z <= (-1.52d-46)) then
                      tmp = (6.0d0 * y) * z
                  else if (z <= 1.15d-134) then
                      tmp = x * 1.0d0
                  else
                      tmp = 6.0d0 * (y * z)
                  end if
                  code = tmp
              end function
              
              public static double code(double x, double y, double z) {
              	double tmp;
              	if (z <= -1.52e-46) {
              		tmp = (6.0 * y) * z;
              	} else if (z <= 1.15e-134) {
              		tmp = x * 1.0;
              	} else {
              		tmp = 6.0 * (y * z);
              	}
              	return tmp;
              }
              
              def code(x, y, z):
              	tmp = 0
              	if z <= -1.52e-46:
              		tmp = (6.0 * y) * z
              	elif z <= 1.15e-134:
              		tmp = x * 1.0
              	else:
              		tmp = 6.0 * (y * z)
              	return tmp
              
              function code(x, y, z)
              	tmp = 0.0
              	if (z <= -1.52e-46)
              		tmp = Float64(Float64(6.0 * y) * z);
              	elseif (z <= 1.15e-134)
              		tmp = Float64(x * 1.0);
              	else
              		tmp = Float64(6.0 * Float64(y * z));
              	end
              	return tmp
              end
              
              function tmp_2 = code(x, y, z)
              	tmp = 0.0;
              	if (z <= -1.52e-46)
              		tmp = (6.0 * y) * z;
              	elseif (z <= 1.15e-134)
              		tmp = x * 1.0;
              	else
              		tmp = 6.0 * (y * z);
              	end
              	tmp_2 = tmp;
              end
              
              code[x_, y_, z_] := If[LessEqual[z, -1.52e-46], N[(N[(6.0 * y), $MachinePrecision] * z), $MachinePrecision], If[LessEqual[z, 1.15e-134], N[(x * 1.0), $MachinePrecision], N[(6.0 * N[(y * z), $MachinePrecision]), $MachinePrecision]]]
              
              \begin{array}{l}
              
              \\
              \begin{array}{l}
              \mathbf{if}\;z \leq -1.52 \cdot 10^{-46}:\\
              \;\;\;\;\left(6 \cdot y\right) \cdot z\\
              
              \mathbf{elif}\;z \leq 1.15 \cdot 10^{-134}:\\
              \;\;\;\;x \cdot 1\\
              
              \mathbf{else}:\\
              \;\;\;\;6 \cdot \left(y \cdot z\right)\\
              
              
              \end{array}
              \end{array}
              
              Derivation
              1. Split input into 3 regimes
              2. if z < -1.52000000000000006e-46

                1. Initial program 99.7%

                  \[x + \left(\left(y - x\right) \cdot 6\right) \cdot z \]
                2. Taylor expanded in x around 0

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

                    \[\leadsto 6 \cdot \color{blue}{\left(y \cdot z\right)} \]
                  2. lower-*.f6442.8

                    \[\leadsto 6 \cdot \left(y \cdot \color{blue}{z}\right) \]
                4. Applied rewrites42.8%

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

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

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

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

                    \[\leadsto \left(6 \cdot y\right) \cdot \color{blue}{z} \]
                  5. lower-*.f6442.8

                    \[\leadsto \left(6 \cdot y\right) \cdot z \]
                6. Applied rewrites42.8%

                  \[\leadsto \left(6 \cdot y\right) \cdot \color{blue}{z} \]

                if -1.52000000000000006e-46 < z < 1.15e-134

                1. Initial program 99.7%

                  \[x + \left(\left(y - x\right) \cdot 6\right) \cdot z \]
                2. Step-by-step derivation
                  1. lift-+.f64N/A

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

                    \[\leadsto \color{blue}{\left(\left(y - x\right) \cdot 6\right) \cdot z + x} \]
                  3. add-flipN/A

                    \[\leadsto \color{blue}{\left(\left(y - x\right) \cdot 6\right) \cdot z - \left(\mathsf{neg}\left(x\right)\right)} \]
                  4. *-lft-identityN/A

                    \[\leadsto \left(\left(y - x\right) \cdot 6\right) \cdot z - \color{blue}{1 \cdot \left(\mathsf{neg}\left(x\right)\right)} \]
                  5. fp-cancel-sub-sign-invN/A

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

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

                    \[\leadsto \color{blue}{\left(\left(y - x\right) \cdot 6\right)} \cdot z + \left(\mathsf{neg}\left(1\right)\right) \cdot \left(\mathsf{neg}\left(x\right)\right) \]
                  8. associate-*l*N/A

                    \[\leadsto \color{blue}{\left(y - x\right) \cdot \left(6 \cdot z\right)} + \left(\mathsf{neg}\left(1\right)\right) \cdot \left(\mathsf{neg}\left(x\right)\right) \]
                  9. *-commutativeN/A

                    \[\leadsto \left(y - x\right) \cdot \color{blue}{\left(z \cdot 6\right)} + \left(\mathsf{neg}\left(1\right)\right) \cdot \left(\mathsf{neg}\left(x\right)\right) \]
                  10. associate-*r*N/A

                    \[\leadsto \color{blue}{\left(\left(y - x\right) \cdot z\right) \cdot 6} + \left(\mathsf{neg}\left(1\right)\right) \cdot \left(\mathsf{neg}\left(x\right)\right) \]
                  11. *-commutativeN/A

                    \[\leadsto \color{blue}{\left(z \cdot \left(y - x\right)\right)} \cdot 6 + \left(\mathsf{neg}\left(1\right)\right) \cdot \left(\mathsf{neg}\left(x\right)\right) \]
                  12. remove-double-negN/A

                    \[\leadsto \left(z \cdot \left(y - x\right)\right) \cdot \color{blue}{\left(\mathsf{neg}\left(\left(\mathsf{neg}\left(6\right)\right)\right)\right)} + \left(\mathsf{neg}\left(1\right)\right) \cdot \left(\mathsf{neg}\left(x\right)\right) \]
                  13. distribute-rgt-neg-outN/A

                    \[\leadsto \color{blue}{\left(\mathsf{neg}\left(\left(z \cdot \left(y - x\right)\right) \cdot \left(\mathsf{neg}\left(6\right)\right)\right)\right)} + \left(\mathsf{neg}\left(1\right)\right) \cdot \left(\mathsf{neg}\left(x\right)\right) \]
                  14. distribute-lft-neg-inN/A

                    \[\leadsto \color{blue}{\left(\mathsf{neg}\left(z \cdot \left(y - x\right)\right)\right) \cdot \left(\mathsf{neg}\left(6\right)\right)} + \left(\mathsf{neg}\left(1\right)\right) \cdot \left(\mathsf{neg}\left(x\right)\right) \]
                  15. distribute-lft-neg-outN/A

                    \[\leadsto \left(\mathsf{neg}\left(z \cdot \left(y - x\right)\right)\right) \cdot \left(\mathsf{neg}\left(6\right)\right) + \color{blue}{\left(\mathsf{neg}\left(1 \cdot \left(\mathsf{neg}\left(x\right)\right)\right)\right)} \]
                  16. *-lft-identityN/A

                    \[\leadsto \left(\mathsf{neg}\left(z \cdot \left(y - x\right)\right)\right) \cdot \left(\mathsf{neg}\left(6\right)\right) + \left(\mathsf{neg}\left(\color{blue}{\left(\mathsf{neg}\left(x\right)\right)}\right)\right) \]
                  17. remove-double-negN/A

                    \[\leadsto \left(\mathsf{neg}\left(z \cdot \left(y - x\right)\right)\right) \cdot \left(\mathsf{neg}\left(6\right)\right) + \color{blue}{x} \]
                  18. lower-fma.f64N/A

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

                    \[\leadsto \mathsf{fma}\left(\mathsf{neg}\left(\color{blue}{\left(y - x\right) \cdot z}\right), \mathsf{neg}\left(6\right), x\right) \]
                  20. distribute-lft-neg-outN/A

                    \[\leadsto \mathsf{fma}\left(\color{blue}{\left(\mathsf{neg}\left(\left(y - x\right)\right)\right) \cdot z}, \mathsf{neg}\left(6\right), x\right) \]
                  21. lift--.f64N/A

                    \[\leadsto \mathsf{fma}\left(\left(\mathsf{neg}\left(\color{blue}{\left(y - x\right)}\right)\right) \cdot z, \mathsf{neg}\left(6\right), x\right) \]
                  22. sub-negate-revN/A

                    \[\leadsto \mathsf{fma}\left(\color{blue}{\left(x - y\right)} \cdot z, \mathsf{neg}\left(6\right), x\right) \]
                  23. lower-*.f64N/A

                    \[\leadsto \mathsf{fma}\left(\color{blue}{\left(x - y\right) \cdot z}, \mathsf{neg}\left(6\right), x\right) \]
                  24. lower--.f64N/A

                    \[\leadsto \mathsf{fma}\left(\color{blue}{\left(x - y\right)} \cdot z, \mathsf{neg}\left(6\right), x\right) \]
                  25. metadata-eval99.8

                    \[\leadsto \mathsf{fma}\left(\left(x - y\right) \cdot z, \color{blue}{-6}, x\right) \]
                3. Applied rewrites99.8%

                  \[\leadsto \color{blue}{\mathsf{fma}\left(\left(x - y\right) \cdot z, -6, x\right)} \]
                4. Taylor expanded in x around inf

                  \[\leadsto \color{blue}{x \cdot \left(1 + -6 \cdot z\right)} \]
                5. Step-by-step derivation
                  1. lower-*.f64N/A

                    \[\leadsto x \cdot \color{blue}{\left(1 + -6 \cdot z\right)} \]
                  2. lower-+.f64N/A

                    \[\leadsto x \cdot \left(1 + \color{blue}{-6 \cdot z}\right) \]
                  3. lower-*.f6460.6

                    \[\leadsto x \cdot \left(1 + -6 \cdot \color{blue}{z}\right) \]
                6. Applied rewrites60.6%

                  \[\leadsto \color{blue}{x \cdot \left(1 + -6 \cdot z\right)} \]
                7. Taylor expanded in z around 0

                  \[\leadsto x \cdot 1 \]
                8. Step-by-step derivation
                  1. Applied rewrites35.4%

                    \[\leadsto x \cdot 1 \]

                  if 1.15e-134 < z

                  1. Initial program 99.7%

                    \[x + \left(\left(y - x\right) \cdot 6\right) \cdot z \]
                  2. Taylor expanded in x around 0

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

                      \[\leadsto 6 \cdot \color{blue}{\left(y \cdot z\right)} \]
                    2. lower-*.f6442.8

                      \[\leadsto 6 \cdot \left(y \cdot \color{blue}{z}\right) \]
                  4. Applied rewrites42.8%

                    \[\leadsto \color{blue}{6 \cdot \left(y \cdot z\right)} \]
                9. Recombined 3 regimes into one program.
                10. Add Preprocessing

                Alternative 11: 59.3% accurate, 0.8× speedup?

                \[\begin{array}{l} \\ \begin{array}{l} t_0 := 6 \cdot \left(y \cdot z\right)\\ \mathbf{if}\;z \leq -1.52 \cdot 10^{-46}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;z \leq 1.15 \cdot 10^{-134}:\\ \;\;\;\;x \cdot 1\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
                (FPCore (x y z)
                 :precision binary64
                 (let* ((t_0 (* 6.0 (* y z))))
                   (if (<= z -1.52e-46) t_0 (if (<= z 1.15e-134) (* x 1.0) t_0))))
                double code(double x, double y, double z) {
                	double t_0 = 6.0 * (y * z);
                	double tmp;
                	if (z <= -1.52e-46) {
                		tmp = t_0;
                	} else if (z <= 1.15e-134) {
                		tmp = x * 1.0;
                	} else {
                		tmp = t_0;
                	}
                	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)
                use fmin_fmax_functions
                    real(8), intent (in) :: x
                    real(8), intent (in) :: y
                    real(8), intent (in) :: z
                    real(8) :: t_0
                    real(8) :: tmp
                    t_0 = 6.0d0 * (y * z)
                    if (z <= (-1.52d-46)) then
                        tmp = t_0
                    else if (z <= 1.15d-134) then
                        tmp = x * 1.0d0
                    else
                        tmp = t_0
                    end if
                    code = tmp
                end function
                
                public static double code(double x, double y, double z) {
                	double t_0 = 6.0 * (y * z);
                	double tmp;
                	if (z <= -1.52e-46) {
                		tmp = t_0;
                	} else if (z <= 1.15e-134) {
                		tmp = x * 1.0;
                	} else {
                		tmp = t_0;
                	}
                	return tmp;
                }
                
                def code(x, y, z):
                	t_0 = 6.0 * (y * z)
                	tmp = 0
                	if z <= -1.52e-46:
                		tmp = t_0
                	elif z <= 1.15e-134:
                		tmp = x * 1.0
                	else:
                		tmp = t_0
                	return tmp
                
                function code(x, y, z)
                	t_0 = Float64(6.0 * Float64(y * z))
                	tmp = 0.0
                	if (z <= -1.52e-46)
                		tmp = t_0;
                	elseif (z <= 1.15e-134)
                		tmp = Float64(x * 1.0);
                	else
                		tmp = t_0;
                	end
                	return tmp
                end
                
                function tmp_2 = code(x, y, z)
                	t_0 = 6.0 * (y * z);
                	tmp = 0.0;
                	if (z <= -1.52e-46)
                		tmp = t_0;
                	elseif (z <= 1.15e-134)
                		tmp = x * 1.0;
                	else
                		tmp = t_0;
                	end
                	tmp_2 = tmp;
                end
                
                code[x_, y_, z_] := Block[{t$95$0 = N[(6.0 * N[(y * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.52e-46], t$95$0, If[LessEqual[z, 1.15e-134], N[(x * 1.0), $MachinePrecision], t$95$0]]]
                
                \begin{array}{l}
                
                \\
                \begin{array}{l}
                t_0 := 6 \cdot \left(y \cdot z\right)\\
                \mathbf{if}\;z \leq -1.52 \cdot 10^{-46}:\\
                \;\;\;\;t\_0\\
                
                \mathbf{elif}\;z \leq 1.15 \cdot 10^{-134}:\\
                \;\;\;\;x \cdot 1\\
                
                \mathbf{else}:\\
                \;\;\;\;t\_0\\
                
                
                \end{array}
                \end{array}
                
                Derivation
                1. Split input into 2 regimes
                2. if z < -1.52000000000000006e-46 or 1.15e-134 < z

                  1. Initial program 99.7%

                    \[x + \left(\left(y - x\right) \cdot 6\right) \cdot z \]
                  2. Taylor expanded in x around 0

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

                      \[\leadsto 6 \cdot \color{blue}{\left(y \cdot z\right)} \]
                    2. lower-*.f6442.8

                      \[\leadsto 6 \cdot \left(y \cdot \color{blue}{z}\right) \]
                  4. Applied rewrites42.8%

                    \[\leadsto \color{blue}{6 \cdot \left(y \cdot z\right)} \]

                  if -1.52000000000000006e-46 < z < 1.15e-134

                  1. Initial program 99.7%

                    \[x + \left(\left(y - x\right) \cdot 6\right) \cdot z \]
                  2. Step-by-step derivation
                    1. lift-+.f64N/A

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

                      \[\leadsto \color{blue}{\left(\left(y - x\right) \cdot 6\right) \cdot z + x} \]
                    3. add-flipN/A

                      \[\leadsto \color{blue}{\left(\left(y - x\right) \cdot 6\right) \cdot z - \left(\mathsf{neg}\left(x\right)\right)} \]
                    4. *-lft-identityN/A

                      \[\leadsto \left(\left(y - x\right) \cdot 6\right) \cdot z - \color{blue}{1 \cdot \left(\mathsf{neg}\left(x\right)\right)} \]
                    5. fp-cancel-sub-sign-invN/A

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

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

                      \[\leadsto \color{blue}{\left(\left(y - x\right) \cdot 6\right)} \cdot z + \left(\mathsf{neg}\left(1\right)\right) \cdot \left(\mathsf{neg}\left(x\right)\right) \]
                    8. associate-*l*N/A

                      \[\leadsto \color{blue}{\left(y - x\right) \cdot \left(6 \cdot z\right)} + \left(\mathsf{neg}\left(1\right)\right) \cdot \left(\mathsf{neg}\left(x\right)\right) \]
                    9. *-commutativeN/A

                      \[\leadsto \left(y - x\right) \cdot \color{blue}{\left(z \cdot 6\right)} + \left(\mathsf{neg}\left(1\right)\right) \cdot \left(\mathsf{neg}\left(x\right)\right) \]
                    10. associate-*r*N/A

                      \[\leadsto \color{blue}{\left(\left(y - x\right) \cdot z\right) \cdot 6} + \left(\mathsf{neg}\left(1\right)\right) \cdot \left(\mathsf{neg}\left(x\right)\right) \]
                    11. *-commutativeN/A

                      \[\leadsto \color{blue}{\left(z \cdot \left(y - x\right)\right)} \cdot 6 + \left(\mathsf{neg}\left(1\right)\right) \cdot \left(\mathsf{neg}\left(x\right)\right) \]
                    12. remove-double-negN/A

                      \[\leadsto \left(z \cdot \left(y - x\right)\right) \cdot \color{blue}{\left(\mathsf{neg}\left(\left(\mathsf{neg}\left(6\right)\right)\right)\right)} + \left(\mathsf{neg}\left(1\right)\right) \cdot \left(\mathsf{neg}\left(x\right)\right) \]
                    13. distribute-rgt-neg-outN/A

                      \[\leadsto \color{blue}{\left(\mathsf{neg}\left(\left(z \cdot \left(y - x\right)\right) \cdot \left(\mathsf{neg}\left(6\right)\right)\right)\right)} + \left(\mathsf{neg}\left(1\right)\right) \cdot \left(\mathsf{neg}\left(x\right)\right) \]
                    14. distribute-lft-neg-inN/A

                      \[\leadsto \color{blue}{\left(\mathsf{neg}\left(z \cdot \left(y - x\right)\right)\right) \cdot \left(\mathsf{neg}\left(6\right)\right)} + \left(\mathsf{neg}\left(1\right)\right) \cdot \left(\mathsf{neg}\left(x\right)\right) \]
                    15. distribute-lft-neg-outN/A

                      \[\leadsto \left(\mathsf{neg}\left(z \cdot \left(y - x\right)\right)\right) \cdot \left(\mathsf{neg}\left(6\right)\right) + \color{blue}{\left(\mathsf{neg}\left(1 \cdot \left(\mathsf{neg}\left(x\right)\right)\right)\right)} \]
                    16. *-lft-identityN/A

                      \[\leadsto \left(\mathsf{neg}\left(z \cdot \left(y - x\right)\right)\right) \cdot \left(\mathsf{neg}\left(6\right)\right) + \left(\mathsf{neg}\left(\color{blue}{\left(\mathsf{neg}\left(x\right)\right)}\right)\right) \]
                    17. remove-double-negN/A

                      \[\leadsto \left(\mathsf{neg}\left(z \cdot \left(y - x\right)\right)\right) \cdot \left(\mathsf{neg}\left(6\right)\right) + \color{blue}{x} \]
                    18. lower-fma.f64N/A

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

                      \[\leadsto \mathsf{fma}\left(\mathsf{neg}\left(\color{blue}{\left(y - x\right) \cdot z}\right), \mathsf{neg}\left(6\right), x\right) \]
                    20. distribute-lft-neg-outN/A

                      \[\leadsto \mathsf{fma}\left(\color{blue}{\left(\mathsf{neg}\left(\left(y - x\right)\right)\right) \cdot z}, \mathsf{neg}\left(6\right), x\right) \]
                    21. lift--.f64N/A

                      \[\leadsto \mathsf{fma}\left(\left(\mathsf{neg}\left(\color{blue}{\left(y - x\right)}\right)\right) \cdot z, \mathsf{neg}\left(6\right), x\right) \]
                    22. sub-negate-revN/A

                      \[\leadsto \mathsf{fma}\left(\color{blue}{\left(x - y\right)} \cdot z, \mathsf{neg}\left(6\right), x\right) \]
                    23. lower-*.f64N/A

                      \[\leadsto \mathsf{fma}\left(\color{blue}{\left(x - y\right) \cdot z}, \mathsf{neg}\left(6\right), x\right) \]
                    24. lower--.f64N/A

                      \[\leadsto \mathsf{fma}\left(\color{blue}{\left(x - y\right)} \cdot z, \mathsf{neg}\left(6\right), x\right) \]
                    25. metadata-eval99.8

                      \[\leadsto \mathsf{fma}\left(\left(x - y\right) \cdot z, \color{blue}{-6}, x\right) \]
                  3. Applied rewrites99.8%

                    \[\leadsto \color{blue}{\mathsf{fma}\left(\left(x - y\right) \cdot z, -6, x\right)} \]
                  4. Taylor expanded in x around inf

                    \[\leadsto \color{blue}{x \cdot \left(1 + -6 \cdot z\right)} \]
                  5. Step-by-step derivation
                    1. lower-*.f64N/A

                      \[\leadsto x \cdot \color{blue}{\left(1 + -6 \cdot z\right)} \]
                    2. lower-+.f64N/A

                      \[\leadsto x \cdot \left(1 + \color{blue}{-6 \cdot z}\right) \]
                    3. lower-*.f6460.6

                      \[\leadsto x \cdot \left(1 + -6 \cdot \color{blue}{z}\right) \]
                  6. Applied rewrites60.6%

                    \[\leadsto \color{blue}{x \cdot \left(1 + -6 \cdot z\right)} \]
                  7. Taylor expanded in z around 0

                    \[\leadsto x \cdot 1 \]
                  8. Step-by-step derivation
                    1. Applied rewrites35.4%

                      \[\leadsto x \cdot 1 \]
                  9. Recombined 2 regimes into one program.
                  10. Add Preprocessing

                  Alternative 12: 35.4% accurate, 3.1× speedup?

                  \[\begin{array}{l} \\ x \cdot 1 \end{array} \]
                  (FPCore (x y z) :precision binary64 (* x 1.0))
                  double code(double x, double y, double z) {
                  	return x * 1.0;
                  }
                  
                  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)
                  use fmin_fmax_functions
                      real(8), intent (in) :: x
                      real(8), intent (in) :: y
                      real(8), intent (in) :: z
                      code = x * 1.0d0
                  end function
                  
                  public static double code(double x, double y, double z) {
                  	return x * 1.0;
                  }
                  
                  def code(x, y, z):
                  	return x * 1.0
                  
                  function code(x, y, z)
                  	return Float64(x * 1.0)
                  end
                  
                  function tmp = code(x, y, z)
                  	tmp = x * 1.0;
                  end
                  
                  code[x_, y_, z_] := N[(x * 1.0), $MachinePrecision]
                  
                  \begin{array}{l}
                  
                  \\
                  x \cdot 1
                  \end{array}
                  
                  Derivation
                  1. Initial program 99.7%

                    \[x + \left(\left(y - x\right) \cdot 6\right) \cdot z \]
                  2. Step-by-step derivation
                    1. lift-+.f64N/A

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

                      \[\leadsto \color{blue}{\left(\left(y - x\right) \cdot 6\right) \cdot z + x} \]
                    3. add-flipN/A

                      \[\leadsto \color{blue}{\left(\left(y - x\right) \cdot 6\right) \cdot z - \left(\mathsf{neg}\left(x\right)\right)} \]
                    4. *-lft-identityN/A

                      \[\leadsto \left(\left(y - x\right) \cdot 6\right) \cdot z - \color{blue}{1 \cdot \left(\mathsf{neg}\left(x\right)\right)} \]
                    5. fp-cancel-sub-sign-invN/A

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

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

                      \[\leadsto \color{blue}{\left(\left(y - x\right) \cdot 6\right)} \cdot z + \left(\mathsf{neg}\left(1\right)\right) \cdot \left(\mathsf{neg}\left(x\right)\right) \]
                    8. associate-*l*N/A

                      \[\leadsto \color{blue}{\left(y - x\right) \cdot \left(6 \cdot z\right)} + \left(\mathsf{neg}\left(1\right)\right) \cdot \left(\mathsf{neg}\left(x\right)\right) \]
                    9. *-commutativeN/A

                      \[\leadsto \left(y - x\right) \cdot \color{blue}{\left(z \cdot 6\right)} + \left(\mathsf{neg}\left(1\right)\right) \cdot \left(\mathsf{neg}\left(x\right)\right) \]
                    10. associate-*r*N/A

                      \[\leadsto \color{blue}{\left(\left(y - x\right) \cdot z\right) \cdot 6} + \left(\mathsf{neg}\left(1\right)\right) \cdot \left(\mathsf{neg}\left(x\right)\right) \]
                    11. *-commutativeN/A

                      \[\leadsto \color{blue}{\left(z \cdot \left(y - x\right)\right)} \cdot 6 + \left(\mathsf{neg}\left(1\right)\right) \cdot \left(\mathsf{neg}\left(x\right)\right) \]
                    12. remove-double-negN/A

                      \[\leadsto \left(z \cdot \left(y - x\right)\right) \cdot \color{blue}{\left(\mathsf{neg}\left(\left(\mathsf{neg}\left(6\right)\right)\right)\right)} + \left(\mathsf{neg}\left(1\right)\right) \cdot \left(\mathsf{neg}\left(x\right)\right) \]
                    13. distribute-rgt-neg-outN/A

                      \[\leadsto \color{blue}{\left(\mathsf{neg}\left(\left(z \cdot \left(y - x\right)\right) \cdot \left(\mathsf{neg}\left(6\right)\right)\right)\right)} + \left(\mathsf{neg}\left(1\right)\right) \cdot \left(\mathsf{neg}\left(x\right)\right) \]
                    14. distribute-lft-neg-inN/A

                      \[\leadsto \color{blue}{\left(\mathsf{neg}\left(z \cdot \left(y - x\right)\right)\right) \cdot \left(\mathsf{neg}\left(6\right)\right)} + \left(\mathsf{neg}\left(1\right)\right) \cdot \left(\mathsf{neg}\left(x\right)\right) \]
                    15. distribute-lft-neg-outN/A

                      \[\leadsto \left(\mathsf{neg}\left(z \cdot \left(y - x\right)\right)\right) \cdot \left(\mathsf{neg}\left(6\right)\right) + \color{blue}{\left(\mathsf{neg}\left(1 \cdot \left(\mathsf{neg}\left(x\right)\right)\right)\right)} \]
                    16. *-lft-identityN/A

                      \[\leadsto \left(\mathsf{neg}\left(z \cdot \left(y - x\right)\right)\right) \cdot \left(\mathsf{neg}\left(6\right)\right) + \left(\mathsf{neg}\left(\color{blue}{\left(\mathsf{neg}\left(x\right)\right)}\right)\right) \]
                    17. remove-double-negN/A

                      \[\leadsto \left(\mathsf{neg}\left(z \cdot \left(y - x\right)\right)\right) \cdot \left(\mathsf{neg}\left(6\right)\right) + \color{blue}{x} \]
                    18. lower-fma.f64N/A

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

                      \[\leadsto \mathsf{fma}\left(\mathsf{neg}\left(\color{blue}{\left(y - x\right) \cdot z}\right), \mathsf{neg}\left(6\right), x\right) \]
                    20. distribute-lft-neg-outN/A

                      \[\leadsto \mathsf{fma}\left(\color{blue}{\left(\mathsf{neg}\left(\left(y - x\right)\right)\right) \cdot z}, \mathsf{neg}\left(6\right), x\right) \]
                    21. lift--.f64N/A

                      \[\leadsto \mathsf{fma}\left(\left(\mathsf{neg}\left(\color{blue}{\left(y - x\right)}\right)\right) \cdot z, \mathsf{neg}\left(6\right), x\right) \]
                    22. sub-negate-revN/A

                      \[\leadsto \mathsf{fma}\left(\color{blue}{\left(x - y\right)} \cdot z, \mathsf{neg}\left(6\right), x\right) \]
                    23. lower-*.f64N/A

                      \[\leadsto \mathsf{fma}\left(\color{blue}{\left(x - y\right) \cdot z}, \mathsf{neg}\left(6\right), x\right) \]
                    24. lower--.f64N/A

                      \[\leadsto \mathsf{fma}\left(\color{blue}{\left(x - y\right)} \cdot z, \mathsf{neg}\left(6\right), x\right) \]
                    25. metadata-eval99.8

                      \[\leadsto \mathsf{fma}\left(\left(x - y\right) \cdot z, \color{blue}{-6}, x\right) \]
                  3. Applied rewrites99.8%

                    \[\leadsto \color{blue}{\mathsf{fma}\left(\left(x - y\right) \cdot z, -6, x\right)} \]
                  4. Taylor expanded in x around inf

                    \[\leadsto \color{blue}{x \cdot \left(1 + -6 \cdot z\right)} \]
                  5. Step-by-step derivation
                    1. lower-*.f64N/A

                      \[\leadsto x \cdot \color{blue}{\left(1 + -6 \cdot z\right)} \]
                    2. lower-+.f64N/A

                      \[\leadsto x \cdot \left(1 + \color{blue}{-6 \cdot z}\right) \]
                    3. lower-*.f6460.6

                      \[\leadsto x \cdot \left(1 + -6 \cdot \color{blue}{z}\right) \]
                  6. Applied rewrites60.6%

                    \[\leadsto \color{blue}{x \cdot \left(1 + -6 \cdot z\right)} \]
                  7. Taylor expanded in z around 0

                    \[\leadsto x \cdot 1 \]
                  8. Step-by-step derivation
                    1. Applied rewrites35.4%

                      \[\leadsto x \cdot 1 \]
                    2. Add Preprocessing

                    Reproduce

                    ?
                    herbie shell --seed 2025156 
                    (FPCore (x y z)
                      :name "Data.Colour.RGBSpace.HSL:hsl from colour-2.3.3, E"
                      :precision binary64
                      (+ x (* (* (- y x) 6.0) z)))