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

Percentage Accurate: 99.6% → 99.8%
Time: 7.3s
Alternatives: 11
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}

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 11 alternatives:

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

Initial Program: 99.6% 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(z \cdot \left(y - x\right), 6, x\right) \end{array} \]
(FPCore (x y z) :precision binary64 (fma (* z (- y x)) 6.0 x))
double code(double x, double y, double z) {
	return fma((z * (y - x)), 6.0, x);
}
function code(x, y, z)
	return fma(Float64(z * Float64(y - x)), 6.0, x)
end
code[x_, y_, z_] := N[(N[(z * N[(y - x), $MachinePrecision]), $MachinePrecision] * 6.0 + x), $MachinePrecision]
\begin{array}{l}

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

    \[x + \left(\left(y - x\right) \cdot 6\right) \cdot z \]
  2. Add Preprocessing
  3. 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. lift-*.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 61.4% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -2.4 \cdot 10^{-25}:\\ \;\;\;\;\left(y \cdot 6\right) \cdot z\\ \mathbf{elif}\;z \leq 1.12 \cdot 10^{-17}:\\ \;\;\;\;1 \cdot x\\ \mathbf{elif}\;z \leq 1.5 \cdot 10^{+189}:\\ \;\;\;\;\left(z \cdot 6\right) \cdot y\\ \mathbf{else}:\\ \;\;\;\;\left(z \cdot x\right) \cdot -6\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (if (<= z -2.4e-25)
   (* (* y 6.0) z)
   (if (<= z 1.12e-17)
     (* 1.0 x)
     (if (<= z 1.5e+189) (* (* z 6.0) y) (* (* z x) -6.0)))))
double code(double x, double y, double z) {
	double tmp;
	if (z <= -2.4e-25) {
		tmp = (y * 6.0) * z;
	} else if (z <= 1.12e-17) {
		tmp = 1.0 * x;
	} else if (z <= 1.5e+189) {
		tmp = (z * 6.0) * y;
	} else {
		tmp = (z * x) * -6.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) :: tmp
    if (z <= (-2.4d-25)) then
        tmp = (y * 6.0d0) * z
    else if (z <= 1.12d-17) then
        tmp = 1.0d0 * x
    else if (z <= 1.5d+189) then
        tmp = (z * 6.0d0) * y
    else
        tmp = (z * x) * (-6.0d0)
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double tmp;
	if (z <= -2.4e-25) {
		tmp = (y * 6.0) * z;
	} else if (z <= 1.12e-17) {
		tmp = 1.0 * x;
	} else if (z <= 1.5e+189) {
		tmp = (z * 6.0) * y;
	} else {
		tmp = (z * x) * -6.0;
	}
	return tmp;
}
def code(x, y, z):
	tmp = 0
	if z <= -2.4e-25:
		tmp = (y * 6.0) * z
	elif z <= 1.12e-17:
		tmp = 1.0 * x
	elif z <= 1.5e+189:
		tmp = (z * 6.0) * y
	else:
		tmp = (z * x) * -6.0
	return tmp
function code(x, y, z)
	tmp = 0.0
	if (z <= -2.4e-25)
		tmp = Float64(Float64(y * 6.0) * z);
	elseif (z <= 1.12e-17)
		tmp = Float64(1.0 * x);
	elseif (z <= 1.5e+189)
		tmp = Float64(Float64(z * 6.0) * y);
	else
		tmp = Float64(Float64(z * x) * -6.0);
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	tmp = 0.0;
	if (z <= -2.4e-25)
		tmp = (y * 6.0) * z;
	elseif (z <= 1.12e-17)
		tmp = 1.0 * x;
	elseif (z <= 1.5e+189)
		tmp = (z * 6.0) * y;
	else
		tmp = (z * x) * -6.0;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := If[LessEqual[z, -2.4e-25], N[(N[(y * 6.0), $MachinePrecision] * z), $MachinePrecision], If[LessEqual[z, 1.12e-17], N[(1.0 * x), $MachinePrecision], If[LessEqual[z, 1.5e+189], N[(N[(z * 6.0), $MachinePrecision] * y), $MachinePrecision], N[(N[(z * x), $MachinePrecision] * -6.0), $MachinePrecision]]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.4 \cdot 10^{-25}:\\
\;\;\;\;\left(y \cdot 6\right) \cdot z\\

\mathbf{elif}\;z \leq 1.12 \cdot 10^{-17}:\\
\;\;\;\;1 \cdot x\\

\mathbf{elif}\;z \leq 1.5 \cdot 10^{+189}:\\
\;\;\;\;\left(z \cdot 6\right) \cdot y\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -2.40000000000000009e-25

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

      if -2.40000000000000009e-25 < z < 1.12000000000000005e-17

      1. Initial program 99.8%

        \[x + \left(\left(y - x\right) \cdot 6\right) \cdot z \]
      2. Add Preprocessing
      3. 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. lift-*.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto 1 \cdot x \]

        if 1.12000000000000005e-17 < z < 1.4999999999999999e189

        1. Initial program 99.5%

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

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

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

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

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

            \[\leadsto \color{blue}{\left(z \cdot y\right)} \cdot 6 \]
        5. Applied rewrites67.6%

          \[\leadsto \color{blue}{\left(z \cdot y\right) \cdot 6} \]
        6. Step-by-step derivation
          1. Applied rewrites67.7%

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

          if 1.4999999999999999e189 < z

          1. Initial program 99.8%

            \[x + \left(\left(y - x\right) \cdot 6\right) \cdot z \]
          2. Add Preprocessing
          3. 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. lift-*.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

            \[\leadsto 1 \cdot x \]
          9. Step-by-step derivation
            1. Applied rewrites1.5%

              \[\leadsto 1 \cdot x \]
            2. Taylor expanded in z around inf

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

                \[\leadsto \left(z \cdot x\right) \cdot \color{blue}{-6} \]
            4. Recombined 4 regimes into one program.
            5. Final simplification67.0%

              \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -2.4 \cdot 10^{-25}:\\ \;\;\;\;\left(y \cdot 6\right) \cdot z\\ \mathbf{elif}\;z \leq 1.12 \cdot 10^{-17}:\\ \;\;\;\;1 \cdot x\\ \mathbf{elif}\;z \leq 1.5 \cdot 10^{+189}:\\ \;\;\;\;\left(z \cdot 6\right) \cdot y\\ \mathbf{else}:\\ \;\;\;\;\left(z \cdot x\right) \cdot -6\\ \end{array} \]
            6. Add Preprocessing

            Alternative 3: 98.4% accurate, 0.7× speedup?

            \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -1.85 \cdot 10^{-12} \lor \neg \left(z \leq 0.166\right):\\ \;\;\;\;\left(z \cdot \left(y - x\right)\right) \cdot 6\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(y \cdot 6, z, x\right)\\ \end{array} \end{array} \]
            (FPCore (x y z)
             :precision binary64
             (if (or (<= z -1.85e-12) (not (<= z 0.166)))
               (* (* z (- y x)) 6.0)
               (fma (* y 6.0) z x)))
            double code(double x, double y, double z) {
            	double tmp;
            	if ((z <= -1.85e-12) || !(z <= 0.166)) {
            		tmp = (z * (y - x)) * 6.0;
            	} else {
            		tmp = fma((y * 6.0), z, x);
            	}
            	return tmp;
            }
            
            function code(x, y, z)
            	tmp = 0.0
            	if ((z <= -1.85e-12) || !(z <= 0.166))
            		tmp = Float64(Float64(z * Float64(y - x)) * 6.0);
            	else
            		tmp = fma(Float64(y * 6.0), z, x);
            	end
            	return tmp
            end
            
            code[x_, y_, z_] := If[Or[LessEqual[z, -1.85e-12], N[Not[LessEqual[z, 0.166]], $MachinePrecision]], N[(N[(z * N[(y - x), $MachinePrecision]), $MachinePrecision] * 6.0), $MachinePrecision], N[(N[(y * 6.0), $MachinePrecision] * z + x), $MachinePrecision]]
            
            \begin{array}{l}
            
            \\
            \begin{array}{l}
            \mathbf{if}\;z \leq -1.85 \cdot 10^{-12} \lor \neg \left(z \leq 0.166\right):\\
            \;\;\;\;\left(z \cdot \left(y - x\right)\right) \cdot 6\\
            
            \mathbf{else}:\\
            \;\;\;\;\mathsf{fma}\left(y \cdot 6, z, x\right)\\
            
            
            \end{array}
            \end{array}
            
            Derivation
            1. Split input into 2 regimes
            2. if z < -1.84999999999999999e-12 or 0.166000000000000009 < z

              1. Initial program 99.7%

                \[x + \left(\left(y - x\right) \cdot 6\right) \cdot z \]
              2. Add Preprocessing
              3. 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. lift-*.f64N/A

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

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

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

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

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

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

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

                  \[\leadsto \color{blue}{\mathsf{fma}\left(y \cdot y - x \cdot x, \frac{6 \cdot z}{y + x}, x\right)} \]
                11. difference-of-squaresN/A

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

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

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

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

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

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

                  \[\leadsto \mathsf{fma}\left(\left(y + x\right) \cdot \left(y - x\right), \frac{\color{blue}{z \cdot 6}}{y + x}, x\right) \]
                18. lower-+.f6480.0

                  \[\leadsto \mathsf{fma}\left(\left(y + x\right) \cdot \left(y - x\right), \frac{z \cdot 6}{\color{blue}{y + x}}, x\right) \]
              4. Applied rewrites80.0%

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

                \[\leadsto \mathsf{fma}\left(\color{blue}{{y}^{2}}, \frac{z \cdot 6}{y + x}, x\right) \]
              6. Step-by-step derivation
                1. unpow2N/A

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

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

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

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

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

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

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

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

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

              if -1.84999999999999999e-12 < z < 0.166000000000000009

              1. Initial program 99.8%

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

                \[\leadsto x + \color{blue}{\left(6 \cdot y\right)} \cdot z \]
              4. Step-by-step derivation
                1. lower-*.f6499.3

                  \[\leadsto x + \color{blue}{\left(6 \cdot y\right)} \cdot z \]
              5. Applied rewrites99.3%

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

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

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

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

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

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

              \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.85 \cdot 10^{-12} \lor \neg \left(z \leq 0.166\right):\\ \;\;\;\;\left(z \cdot \left(y - x\right)\right) \cdot 6\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(y \cdot 6, z, x\right)\\ \end{array} \]
            5. Add Preprocessing

            Alternative 4: 86.8% accurate, 0.7× speedup?

            \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -9.5 \cdot 10^{-102} \lor \neg \left(y \leq 9 \cdot 10^{-56}\right):\\ \;\;\;\;\mathsf{fma}\left(y \cdot 6, z, x\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(x \cdot z, -6, x\right)\\ \end{array} \end{array} \]
            (FPCore (x y z)
             :precision binary64
             (if (or (<= y -9.5e-102) (not (<= y 9e-56)))
               (fma (* y 6.0) z x)
               (fma (* x z) -6.0 x)))
            double code(double x, double y, double z) {
            	double tmp;
            	if ((y <= -9.5e-102) || !(y <= 9e-56)) {
            		tmp = fma((y * 6.0), z, x);
            	} else {
            		tmp = fma((x * z), -6.0, x);
            	}
            	return tmp;
            }
            
            function code(x, y, z)
            	tmp = 0.0
            	if ((y <= -9.5e-102) || !(y <= 9e-56))
            		tmp = fma(Float64(y * 6.0), z, x);
            	else
            		tmp = fma(Float64(x * z), -6.0, x);
            	end
            	return tmp
            end
            
            code[x_, y_, z_] := If[Or[LessEqual[y, -9.5e-102], N[Not[LessEqual[y, 9e-56]], $MachinePrecision]], N[(N[(y * 6.0), $MachinePrecision] * z + x), $MachinePrecision], N[(N[(x * z), $MachinePrecision] * -6.0 + x), $MachinePrecision]]
            
            \begin{array}{l}
            
            \\
            \begin{array}{l}
            \mathbf{if}\;y \leq -9.5 \cdot 10^{-102} \lor \neg \left(y \leq 9 \cdot 10^{-56}\right):\\
            \;\;\;\;\mathsf{fma}\left(y \cdot 6, z, x\right)\\
            
            \mathbf{else}:\\
            \;\;\;\;\mathsf{fma}\left(x \cdot z, -6, x\right)\\
            
            
            \end{array}
            \end{array}
            
            Derivation
            1. Split input into 2 regimes
            2. if y < -9.50000000000000025e-102 or 9.0000000000000001e-56 < y

              1. Initial program 99.7%

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

                \[\leadsto x + \color{blue}{\left(6 \cdot y\right)} \cdot z \]
              4. Step-by-step derivation
                1. lower-*.f6493.2

                  \[\leadsto x + \color{blue}{\left(6 \cdot y\right)} \cdot z \]
              5. Applied rewrites93.2%

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

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

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

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

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

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

              if -9.50000000000000025e-102 < y < 9.0000000000000001e-56

              1. Initial program 99.8%

                \[x + \left(\left(y - x\right) \cdot 6\right) \cdot z \]
              2. Add Preprocessing
              3. 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. lift-*.f64N/A

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

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

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

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

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

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

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

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

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

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

                  \[\leadsto \color{blue}{\mathsf{fma}\left(-6, z, 1\right)} \cdot x \]
              7. Applied rewrites87.2%

                \[\leadsto \color{blue}{\mathsf{fma}\left(-6, z, 1\right) \cdot x} \]
              8. Step-by-step derivation
                1. Applied rewrites87.2%

                  \[\leadsto \mathsf{fma}\left(x \cdot z, \color{blue}{-6}, x\right) \]
              9. Recombined 2 regimes into one program.
              10. Final simplification91.1%

                \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -9.5 \cdot 10^{-102} \lor \neg \left(y \leq 9 \cdot 10^{-56}\right):\\ \;\;\;\;\mathsf{fma}\left(y \cdot 6, z, x\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(x \cdot z, -6, x\right)\\ \end{array} \]
              11. Add Preprocessing

              Alternative 5: 73.9% accurate, 0.7× speedup?

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

                1. Initial program 99.8%

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

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

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

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

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

                    \[\leadsto \color{blue}{\left(z \cdot y\right)} \cdot 6 \]
                5. Applied rewrites70.5%

                  \[\leadsto \color{blue}{\left(z \cdot y\right) \cdot 6} \]
                6. Step-by-step derivation
                  1. Applied rewrites70.5%

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

                  if -9.00000000000000009e-32 < y < 2.40000000000000006e124

                  1. Initial program 99.8%

                    \[x + \left(\left(y - x\right) \cdot 6\right) \cdot z \]
                  2. Add Preprocessing
                  3. 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. lift-*.f64N/A

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

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

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

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

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

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

                    \[\leadsto \mathsf{fma}\left(\color{blue}{-6 \cdot x}, z, x\right) \]
                  6. Step-by-step derivation
                    1. lower-*.f6478.3

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

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

                  if 2.40000000000000006e124 < y

                  1. Initial program 99.5%

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

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

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

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

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

                      \[\leadsto \color{blue}{\left(z \cdot y\right)} \cdot 6 \]
                  5. Applied rewrites82.5%

                    \[\leadsto \color{blue}{\left(z \cdot y\right) \cdot 6} \]
                  6. Step-by-step derivation
                    1. Applied rewrites82.5%

                      \[\leadsto \left(z \cdot 6\right) \cdot \color{blue}{y} \]
                  7. Recombined 3 regimes into one program.
                  8. Final simplification77.1%

                    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -9 \cdot 10^{-32}:\\ \;\;\;\;\left(y \cdot 6\right) \cdot z\\ \mathbf{elif}\;y \leq 2.4 \cdot 10^{+124}:\\ \;\;\;\;\mathsf{fma}\left(-6 \cdot x, z, x\right)\\ \mathbf{else}:\\ \;\;\;\;\left(z \cdot 6\right) \cdot y\\ \end{array} \]
                  9. Add Preprocessing

                  Alternative 6: 74.0% accurate, 0.7× speedup?

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

                    1. Initial program 99.8%

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

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

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

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

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

                        \[\leadsto \color{blue}{\left(z \cdot y\right)} \cdot 6 \]
                    5. Applied rewrites70.5%

                      \[\leadsto \color{blue}{\left(z \cdot y\right) \cdot 6} \]
                    6. Step-by-step derivation
                      1. Applied rewrites70.5%

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

                      if -9.00000000000000009e-32 < y < 2.40000000000000006e124

                      1. Initial program 99.8%

                        \[x + \left(\left(y - x\right) \cdot 6\right) \cdot z \]
                      2. Add Preprocessing
                      3. 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. lift-*.f64N/A

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

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

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

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

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

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

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

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

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

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

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

                        \[\leadsto \color{blue}{\mathsf{fma}\left(-6, z, 1\right) \cdot x} \]
                      8. Step-by-step derivation
                        1. Applied rewrites78.3%

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

                        if 2.40000000000000006e124 < y

                        1. Initial program 99.5%

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

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

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

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

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

                            \[\leadsto \color{blue}{\left(z \cdot y\right)} \cdot 6 \]
                        5. Applied rewrites82.5%

                          \[\leadsto \color{blue}{\left(z \cdot y\right) \cdot 6} \]
                        6. Step-by-step derivation
                          1. Applied rewrites82.5%

                            \[\leadsto \left(z \cdot 6\right) \cdot \color{blue}{y} \]
                        7. Recombined 3 regimes into one program.
                        8. Final simplification77.1%

                          \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -9 \cdot 10^{-32}:\\ \;\;\;\;\left(y \cdot 6\right) \cdot z\\ \mathbf{elif}\;y \leq 2.4 \cdot 10^{+124}:\\ \;\;\;\;\mathsf{fma}\left(x \cdot z, -6, x\right)\\ \mathbf{else}:\\ \;\;\;\;\left(z \cdot 6\right) \cdot y\\ \end{array} \]
                        9. Add Preprocessing

                        Alternative 7: 74.0% accurate, 0.7× speedup?

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

                          1. Initial program 99.8%

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

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

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

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

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

                              \[\leadsto \color{blue}{\left(z \cdot y\right)} \cdot 6 \]
                          5. Applied rewrites70.5%

                            \[\leadsto \color{blue}{\left(z \cdot y\right) \cdot 6} \]
                          6. Step-by-step derivation
                            1. Applied rewrites70.5%

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

                            if -9.00000000000000009e-32 < y < 2.40000000000000006e124

                            1. Initial program 99.8%

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

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

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

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

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

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

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

                            if 2.40000000000000006e124 < y

                            1. Initial program 99.5%

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

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

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

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

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

                                \[\leadsto \color{blue}{\left(z \cdot y\right)} \cdot 6 \]
                            5. Applied rewrites82.5%

                              \[\leadsto \color{blue}{\left(z \cdot y\right) \cdot 6} \]
                            6. Step-by-step derivation
                              1. Applied rewrites82.5%

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

                            Alternative 8: 61.5% accurate, 0.7× speedup?

                            \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -2.4 \cdot 10^{-25} \lor \neg \left(z \leq 1.12 \cdot 10^{-17}\right):\\ \;\;\;\;\left(y \cdot 6\right) \cdot z\\ \mathbf{else}:\\ \;\;\;\;1 \cdot x\\ \end{array} \end{array} \]
                            (FPCore (x y z)
                             :precision binary64
                             (if (or (<= z -2.4e-25) (not (<= z 1.12e-17))) (* (* y 6.0) z) (* 1.0 x)))
                            double code(double x, double y, double z) {
                            	double tmp;
                            	if ((z <= -2.4e-25) || !(z <= 1.12e-17)) {
                            		tmp = (y * 6.0) * z;
                            	} else {
                            		tmp = 1.0 * x;
                            	}
                            	return tmp;
                            }
                            
                            module fmin_fmax_functions
                                implicit none
                                private
                                public fmax
                                public fmin
                            
                                interface fmax
                                    module procedure fmax88
                                    module procedure fmax44
                                    module procedure fmax84
                                    module procedure fmax48
                                end interface
                                interface fmin
                                    module procedure fmin88
                                    module procedure fmin44
                                    module procedure fmin84
                                    module procedure fmin48
                                end interface
                            contains
                                real(8) function fmax88(x, y) result (res)
                                    real(8), intent (in) :: x
                                    real(8), intent (in) :: y
                                    res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                end function
                                real(4) function fmax44(x, y) result (res)
                                    real(4), intent (in) :: x
                                    real(4), intent (in) :: y
                                    res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                end function
                                real(8) function fmax84(x, y) result(res)
                                    real(8), intent (in) :: x
                                    real(4), intent (in) :: y
                                    res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                                end function
                                real(8) function fmax48(x, y) result(res)
                                    real(4), intent (in) :: x
                                    real(8), intent (in) :: y
                                    res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                                end function
                                real(8) function fmin88(x, y) result (res)
                                    real(8), intent (in) :: x
                                    real(8), intent (in) :: y
                                    res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                end function
                                real(4) function fmin44(x, y) result (res)
                                    real(4), intent (in) :: x
                                    real(4), intent (in) :: y
                                    res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                end function
                                real(8) function fmin84(x, y) result(res)
                                    real(8), intent (in) :: x
                                    real(4), intent (in) :: y
                                    res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                                end function
                                real(8) function fmin48(x, y) result(res)
                                    real(4), intent (in) :: x
                                    real(8), intent (in) :: y
                                    res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                                end function
                            end module
                            
                            real(8) function code(x, y, z)
                            use fmin_fmax_functions
                                real(8), intent (in) :: x
                                real(8), intent (in) :: y
                                real(8), intent (in) :: z
                                real(8) :: tmp
                                if ((z <= (-2.4d-25)) .or. (.not. (z <= 1.12d-17))) then
                                    tmp = (y * 6.0d0) * z
                                else
                                    tmp = 1.0d0 * x
                                end if
                                code = tmp
                            end function
                            
                            public static double code(double x, double y, double z) {
                            	double tmp;
                            	if ((z <= -2.4e-25) || !(z <= 1.12e-17)) {
                            		tmp = (y * 6.0) * z;
                            	} else {
                            		tmp = 1.0 * x;
                            	}
                            	return tmp;
                            }
                            
                            def code(x, y, z):
                            	tmp = 0
                            	if (z <= -2.4e-25) or not (z <= 1.12e-17):
                            		tmp = (y * 6.0) * z
                            	else:
                            		tmp = 1.0 * x
                            	return tmp
                            
                            function code(x, y, z)
                            	tmp = 0.0
                            	if ((z <= -2.4e-25) || !(z <= 1.12e-17))
                            		tmp = Float64(Float64(y * 6.0) * z);
                            	else
                            		tmp = Float64(1.0 * x);
                            	end
                            	return tmp
                            end
                            
                            function tmp_2 = code(x, y, z)
                            	tmp = 0.0;
                            	if ((z <= -2.4e-25) || ~((z <= 1.12e-17)))
                            		tmp = (y * 6.0) * z;
                            	else
                            		tmp = 1.0 * x;
                            	end
                            	tmp_2 = tmp;
                            end
                            
                            code[x_, y_, z_] := If[Or[LessEqual[z, -2.4e-25], N[Not[LessEqual[z, 1.12e-17]], $MachinePrecision]], N[(N[(y * 6.0), $MachinePrecision] * z), $MachinePrecision], N[(1.0 * x), $MachinePrecision]]
                            
                            \begin{array}{l}
                            
                            \\
                            \begin{array}{l}
                            \mathbf{if}\;z \leq -2.4 \cdot 10^{-25} \lor \neg \left(z \leq 1.12 \cdot 10^{-17}\right):\\
                            \;\;\;\;\left(y \cdot 6\right) \cdot z\\
                            
                            \mathbf{else}:\\
                            \;\;\;\;1 \cdot x\\
                            
                            
                            \end{array}
                            \end{array}
                            
                            Derivation
                            1. Split input into 2 regimes
                            2. if z < -2.40000000000000009e-25 or 1.12000000000000005e-17 < z

                              1. Initial program 99.7%

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

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

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

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

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

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

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

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

                                if -2.40000000000000009e-25 < z < 1.12000000000000005e-17

                                1. Initial program 99.8%

                                  \[x + \left(\left(y - x\right) \cdot 6\right) \cdot z \]
                                2. Add Preprocessing
                                3. 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. lift-*.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

                                    \[\leadsto 1 \cdot x \]
                                10. Recombined 2 regimes into one program.
                                11. Final simplification65.1%

                                  \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -2.4 \cdot 10^{-25} \lor \neg \left(z \leq 1.12 \cdot 10^{-17}\right):\\ \;\;\;\;\left(y \cdot 6\right) \cdot z\\ \mathbf{else}:\\ \;\;\;\;1 \cdot x\\ \end{array} \]
                                12. Add Preprocessing

                                Alternative 9: 61.5% accurate, 0.7× speedup?

                                \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -2.4 \cdot 10^{-25}:\\ \;\;\;\;\left(y \cdot 6\right) \cdot z\\ \mathbf{elif}\;z \leq 1.12 \cdot 10^{-17}:\\ \;\;\;\;1 \cdot x\\ \mathbf{else}:\\ \;\;\;\;\left(z \cdot 6\right) \cdot y\\ \end{array} \end{array} \]
                                (FPCore (x y z)
                                 :precision binary64
                                 (if (<= z -2.4e-25)
                                   (* (* y 6.0) z)
                                   (if (<= z 1.12e-17) (* 1.0 x) (* (* z 6.0) y))))
                                double code(double x, double y, double z) {
                                	double tmp;
                                	if (z <= -2.4e-25) {
                                		tmp = (y * 6.0) * z;
                                	} else if (z <= 1.12e-17) {
                                		tmp = 1.0 * x;
                                	} else {
                                		tmp = (z * 6.0) * y;
                                	}
                                	return tmp;
                                }
                                
                                module fmin_fmax_functions
                                    implicit none
                                    private
                                    public fmax
                                    public fmin
                                
                                    interface fmax
                                        module procedure fmax88
                                        module procedure fmax44
                                        module procedure fmax84
                                        module procedure fmax48
                                    end interface
                                    interface fmin
                                        module procedure fmin88
                                        module procedure fmin44
                                        module procedure fmin84
                                        module procedure fmin48
                                    end interface
                                contains
                                    real(8) function fmax88(x, y) result (res)
                                        real(8), intent (in) :: x
                                        real(8), intent (in) :: y
                                        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                    end function
                                    real(4) function fmax44(x, y) result (res)
                                        real(4), intent (in) :: x
                                        real(4), intent (in) :: y
                                        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                    end function
                                    real(8) function fmax84(x, y) result(res)
                                        real(8), intent (in) :: x
                                        real(4), intent (in) :: y
                                        res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                                    end function
                                    real(8) function fmax48(x, y) result(res)
                                        real(4), intent (in) :: x
                                        real(8), intent (in) :: y
                                        res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                                    end function
                                    real(8) function fmin88(x, y) result (res)
                                        real(8), intent (in) :: x
                                        real(8), intent (in) :: y
                                        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                    end function
                                    real(4) function fmin44(x, y) result (res)
                                        real(4), intent (in) :: x
                                        real(4), intent (in) :: y
                                        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                    end function
                                    real(8) function fmin84(x, y) result(res)
                                        real(8), intent (in) :: x
                                        real(4), intent (in) :: y
                                        res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                                    end function
                                    real(8) function fmin48(x, y) result(res)
                                        real(4), intent (in) :: x
                                        real(8), intent (in) :: y
                                        res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                                    end function
                                end module
                                
                                real(8) function code(x, y, z)
                                use fmin_fmax_functions
                                    real(8), intent (in) :: x
                                    real(8), intent (in) :: y
                                    real(8), intent (in) :: z
                                    real(8) :: tmp
                                    if (z <= (-2.4d-25)) then
                                        tmp = (y * 6.0d0) * z
                                    else if (z <= 1.12d-17) then
                                        tmp = 1.0d0 * x
                                    else
                                        tmp = (z * 6.0d0) * y
                                    end if
                                    code = tmp
                                end function
                                
                                public static double code(double x, double y, double z) {
                                	double tmp;
                                	if (z <= -2.4e-25) {
                                		tmp = (y * 6.0) * z;
                                	} else if (z <= 1.12e-17) {
                                		tmp = 1.0 * x;
                                	} else {
                                		tmp = (z * 6.0) * y;
                                	}
                                	return tmp;
                                }
                                
                                def code(x, y, z):
                                	tmp = 0
                                	if z <= -2.4e-25:
                                		tmp = (y * 6.0) * z
                                	elif z <= 1.12e-17:
                                		tmp = 1.0 * x
                                	else:
                                		tmp = (z * 6.0) * y
                                	return tmp
                                
                                function code(x, y, z)
                                	tmp = 0.0
                                	if (z <= -2.4e-25)
                                		tmp = Float64(Float64(y * 6.0) * z);
                                	elseif (z <= 1.12e-17)
                                		tmp = Float64(1.0 * x);
                                	else
                                		tmp = Float64(Float64(z * 6.0) * y);
                                	end
                                	return tmp
                                end
                                
                                function tmp_2 = code(x, y, z)
                                	tmp = 0.0;
                                	if (z <= -2.4e-25)
                                		tmp = (y * 6.0) * z;
                                	elseif (z <= 1.12e-17)
                                		tmp = 1.0 * x;
                                	else
                                		tmp = (z * 6.0) * y;
                                	end
                                	tmp_2 = tmp;
                                end
                                
                                code[x_, y_, z_] := If[LessEqual[z, -2.4e-25], N[(N[(y * 6.0), $MachinePrecision] * z), $MachinePrecision], If[LessEqual[z, 1.12e-17], N[(1.0 * x), $MachinePrecision], N[(N[(z * 6.0), $MachinePrecision] * y), $MachinePrecision]]]
                                
                                \begin{array}{l}
                                
                                \\
                                \begin{array}{l}
                                \mathbf{if}\;z \leq -2.4 \cdot 10^{-25}:\\
                                \;\;\;\;\left(y \cdot 6\right) \cdot z\\
                                
                                \mathbf{elif}\;z \leq 1.12 \cdot 10^{-17}:\\
                                \;\;\;\;1 \cdot x\\
                                
                                \mathbf{else}:\\
                                \;\;\;\;\left(z \cdot 6\right) \cdot y\\
                                
                                
                                \end{array}
                                \end{array}
                                
                                Derivation
                                1. Split input into 3 regimes
                                2. if z < -2.40000000000000009e-25

                                  1. Initial program 99.8%

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

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

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

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

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

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

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

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

                                    if -2.40000000000000009e-25 < z < 1.12000000000000005e-17

                                    1. Initial program 99.8%

                                      \[x + \left(\left(y - x\right) \cdot 6\right) \cdot z \]
                                    2. Add Preprocessing
                                    3. 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. lift-*.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

                                        \[\leadsto 1 \cdot x \]

                                      if 1.12000000000000005e-17 < z

                                      1. Initial program 99.6%

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

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

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

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

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

                                          \[\leadsto \color{blue}{\left(z \cdot y\right)} \cdot 6 \]
                                      5. Applied rewrites58.7%

                                        \[\leadsto \color{blue}{\left(z \cdot y\right) \cdot 6} \]
                                      6. Step-by-step derivation
                                        1. Applied rewrites58.7%

                                          \[\leadsto \left(z \cdot 6\right) \cdot \color{blue}{y} \]
                                      7. Recombined 3 regimes into one program.
                                      8. Final simplification65.1%

                                        \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -2.4 \cdot 10^{-25}:\\ \;\;\;\;\left(y \cdot 6\right) \cdot z\\ \mathbf{elif}\;z \leq 1.12 \cdot 10^{-17}:\\ \;\;\;\;1 \cdot x\\ \mathbf{else}:\\ \;\;\;\;\left(z \cdot 6\right) \cdot y\\ \end{array} \]
                                      9. Add Preprocessing

                                      Alternative 10: 99.6% accurate, 1.1× speedup?

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

                                        \[x + \left(\left(y - x\right) \cdot 6\right) \cdot z \]
                                      2. Add Preprocessing
                                      3. 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. lift-*.f64N/A

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

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

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

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

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

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

                                      Alternative 11: 36.6% accurate, 2.8× speedup?

                                      \[\begin{array}{l} \\ 1 \cdot x \end{array} \]
                                      (FPCore (x y z) :precision binary64 (* 1.0 x))
                                      double code(double x, double y, double z) {
                                      	return 1.0 * x;
                                      }
                                      
                                      module fmin_fmax_functions
                                          implicit none
                                          private
                                          public fmax
                                          public fmin
                                      
                                          interface fmax
                                              module procedure fmax88
                                              module procedure fmax44
                                              module procedure fmax84
                                              module procedure fmax48
                                          end interface
                                          interface fmin
                                              module procedure fmin88
                                              module procedure fmin44
                                              module procedure fmin84
                                              module procedure fmin48
                                          end interface
                                      contains
                                          real(8) function fmax88(x, y) result (res)
                                              real(8), intent (in) :: x
                                              real(8), intent (in) :: y
                                              res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                          end function
                                          real(4) function fmax44(x, y) result (res)
                                              real(4), intent (in) :: x
                                              real(4), intent (in) :: y
                                              res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                          end function
                                          real(8) function fmax84(x, y) result(res)
                                              real(8), intent (in) :: x
                                              real(4), intent (in) :: y
                                              res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                                          end function
                                          real(8) function fmax48(x, y) result(res)
                                              real(4), intent (in) :: x
                                              real(8), intent (in) :: y
                                              res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                                          end function
                                          real(8) function fmin88(x, y) result (res)
                                              real(8), intent (in) :: x
                                              real(8), intent (in) :: y
                                              res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                          end function
                                          real(4) function fmin44(x, y) result (res)
                                              real(4), intent (in) :: x
                                              real(4), intent (in) :: y
                                              res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                          end function
                                          real(8) function fmin84(x, y) result(res)
                                              real(8), intent (in) :: x
                                              real(4), intent (in) :: y
                                              res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                                          end function
                                          real(8) function fmin48(x, y) result(res)
                                              real(4), intent (in) :: x
                                              real(8), intent (in) :: y
                                              res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                                          end function
                                      end module
                                      
                                      real(8) function code(x, y, z)
                                      use fmin_fmax_functions
                                          real(8), intent (in) :: x
                                          real(8), intent (in) :: y
                                          real(8), intent (in) :: z
                                          code = 1.0d0 * x
                                      end function
                                      
                                      public static double code(double x, double y, double z) {
                                      	return 1.0 * x;
                                      }
                                      
                                      def code(x, y, z):
                                      	return 1.0 * x
                                      
                                      function code(x, y, z)
                                      	return Float64(1.0 * x)
                                      end
                                      
                                      function tmp = code(x, y, z)
                                      	tmp = 1.0 * x;
                                      end
                                      
                                      code[x_, y_, z_] := N[(1.0 * x), $MachinePrecision]
                                      
                                      \begin{array}{l}
                                      
                                      \\
                                      1 \cdot x
                                      \end{array}
                                      
                                      Derivation
                                      1. Initial program 99.8%

                                        \[x + \left(\left(y - x\right) \cdot 6\right) \cdot z \]
                                      2. Add Preprocessing
                                      3. 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. lift-*.f64N/A

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

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

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

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

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

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

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

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

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

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

                                          \[\leadsto \color{blue}{\mathsf{fma}\left(-6, z, 1\right)} \cdot x \]
                                      7. Applied rewrites55.9%

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

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

                                          \[\leadsto 1 \cdot x \]
                                        2. Final simplification35.5%

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

                                        Developer Target 1: 99.8% accurate, 1.0× speedup?

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

                                        Reproduce

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