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

Percentage Accurate: 99.7% → 99.7%
Time: 6.2s
Alternatives: 10
Speedup: 1.0×

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);
}
real(8) function code(x, y, z)
    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 10 alternatives:

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

Initial Program: 99.7% accurate, 1.0× speedup?

\[\begin{array}{l} \\ x + \left(\left(y - x\right) \cdot 6\right) \cdot z \end{array} \]
(FPCore (x y z) :precision binary64 (+ x (* (* (- y x) 6.0) z)))
double code(double x, double y, double z) {
	return x + (((y - x) * 6.0) * z);
}
real(8) function code(x, y, z)
    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.7% accurate, 1.0× speedup?

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

\\
x + z \cdot \left(\left(y - x\right) \cdot 6\right)
\end{array}
Derivation
  1. Initial program 99.9%

    \[x + \left(\left(y - x\right) \cdot 6\right) \cdot z \]
  2. Final simplification99.9%

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

Alternative 2: 61.5% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := -6 \cdot \left(x \cdot z\right)\\ t_1 := 6 \cdot \left(y \cdot z\right)\\ \mathbf{if}\;z \leq -2 \cdot 10^{+205}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;z \leq -1.22 \cdot 10^{+148}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq -7.8 \cdot 10^{+59}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;z \leq -4.1 \cdot 10^{-38} \lor \neg \left(z \leq 2.05 \cdot 10^{-59}\right):\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (let* ((t_0 (* -6.0 (* x z))) (t_1 (* 6.0 (* y z))))
   (if (<= z -2e+205)
     t_0
     (if (<= z -1.22e+148)
       t_1
       (if (<= z -7.8e+59)
         t_0
         (if (or (<= z -4.1e-38) (not (<= z 2.05e-59))) t_1 x))))))
double code(double x, double y, double z) {
	double t_0 = -6.0 * (x * z);
	double t_1 = 6.0 * (y * z);
	double tmp;
	if (z <= -2e+205) {
		tmp = t_0;
	} else if (z <= -1.22e+148) {
		tmp = t_1;
	} else if (z <= -7.8e+59) {
		tmp = t_0;
	} else if ((z <= -4.1e-38) || !(z <= 2.05e-59)) {
		tmp = t_1;
	} else {
		tmp = x;
	}
	return tmp;
}
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8) :: t_0
    real(8) :: t_1
    real(8) :: tmp
    t_0 = (-6.0d0) * (x * z)
    t_1 = 6.0d0 * (y * z)
    if (z <= (-2d+205)) then
        tmp = t_0
    else if (z <= (-1.22d+148)) then
        tmp = t_1
    else if (z <= (-7.8d+59)) then
        tmp = t_0
    else if ((z <= (-4.1d-38)) .or. (.not. (z <= 2.05d-59))) then
        tmp = t_1
    else
        tmp = x
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double t_0 = -6.0 * (x * z);
	double t_1 = 6.0 * (y * z);
	double tmp;
	if (z <= -2e+205) {
		tmp = t_0;
	} else if (z <= -1.22e+148) {
		tmp = t_1;
	} else if (z <= -7.8e+59) {
		tmp = t_0;
	} else if ((z <= -4.1e-38) || !(z <= 2.05e-59)) {
		tmp = t_1;
	} else {
		tmp = x;
	}
	return tmp;
}
def code(x, y, z):
	t_0 = -6.0 * (x * z)
	t_1 = 6.0 * (y * z)
	tmp = 0
	if z <= -2e+205:
		tmp = t_0
	elif z <= -1.22e+148:
		tmp = t_1
	elif z <= -7.8e+59:
		tmp = t_0
	elif (z <= -4.1e-38) or not (z <= 2.05e-59):
		tmp = t_1
	else:
		tmp = x
	return tmp
function code(x, y, z)
	t_0 = Float64(-6.0 * Float64(x * z))
	t_1 = Float64(6.0 * Float64(y * z))
	tmp = 0.0
	if (z <= -2e+205)
		tmp = t_0;
	elseif (z <= -1.22e+148)
		tmp = t_1;
	elseif (z <= -7.8e+59)
		tmp = t_0;
	elseif ((z <= -4.1e-38) || !(z <= 2.05e-59))
		tmp = t_1;
	else
		tmp = x;
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	t_0 = -6.0 * (x * z);
	t_1 = 6.0 * (y * z);
	tmp = 0.0;
	if (z <= -2e+205)
		tmp = t_0;
	elseif (z <= -1.22e+148)
		tmp = t_1;
	elseif (z <= -7.8e+59)
		tmp = t_0;
	elseif ((z <= -4.1e-38) || ~((z <= 2.05e-59)))
		tmp = t_1;
	else
		tmp = x;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := Block[{t$95$0 = N[(-6.0 * N[(x * z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(6.0 * N[(y * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2e+205], t$95$0, If[LessEqual[z, -1.22e+148], t$95$1, If[LessEqual[z, -7.8e+59], t$95$0, If[Or[LessEqual[z, -4.1e-38], N[Not[LessEqual[z, 2.05e-59]], $MachinePrecision]], t$95$1, x]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := -6 \cdot \left(x \cdot z\right)\\
t_1 := 6 \cdot \left(y \cdot z\right)\\
\mathbf{if}\;z \leq -2 \cdot 10^{+205}:\\
\;\;\;\;t_0\\

\mathbf{elif}\;z \leq -1.22 \cdot 10^{+148}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;z \leq -7.8 \cdot 10^{+59}:\\
\;\;\;\;t_0\\

\mathbf{elif}\;z \leq -4.1 \cdot 10^{-38} \lor \neg \left(z \leq 2.05 \cdot 10^{-59}\right):\\
\;\;\;\;t_1\\

\mathbf{else}:\\
\;\;\;\;x\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -2.00000000000000003e205 or -1.22000000000000007e148 < z < -7.80000000000000043e59

    1. Initial program 100.0%

      \[x + \left(\left(y - x\right) \cdot 6\right) \cdot z \]
    2. Step-by-step derivation
      1. associate-*r*99.8%

        \[\leadsto x + \color{blue}{\left(y - x\right) \cdot \left(6 \cdot z\right)} \]
      2. +-commutative99.8%

        \[\leadsto \color{blue}{\left(y - x\right) \cdot \left(6 \cdot z\right) + x} \]
      3. *-commutative99.8%

        \[\leadsto \left(y - x\right) \cdot \color{blue}{\left(z \cdot 6\right)} + x \]
      4. associate-*r*99.8%

        \[\leadsto \color{blue}{\left(\left(y - x\right) \cdot z\right) \cdot 6} + x \]
      5. fma-def99.8%

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

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

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

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

        \[\leadsto \color{blue}{\left(\left(y - x\right) \cdot z\right) \cdot 6} \]
      3. associate-*r*99.8%

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

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

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

    if -2.00000000000000003e205 < z < -1.22000000000000007e148 or -7.80000000000000043e59 < z < -4.0999999999999998e-38 or 2.0499999999999998e-59 < z

    1. Initial program 99.7%

      \[x + \left(\left(y - x\right) \cdot 6\right) \cdot z \]
    2. Step-by-step derivation
      1. associate-*r*99.7%

        \[\leadsto x + \color{blue}{\left(y - x\right) \cdot \left(6 \cdot z\right)} \]
      2. +-commutative99.7%

        \[\leadsto \color{blue}{\left(y - x\right) \cdot \left(6 \cdot z\right) + x} \]
      3. *-commutative99.7%

        \[\leadsto \left(y - x\right) \cdot \color{blue}{\left(z \cdot 6\right)} + x \]
      4. associate-*r*99.6%

        \[\leadsto \color{blue}{\left(\left(y - x\right) \cdot z\right) \cdot 6} + x \]
      5. fma-def99.7%

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

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

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

    if -4.0999999999999998e-38 < z < 2.0499999999999998e-59

    1. Initial program 99.9%

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

      \[\leadsto \color{blue}{x} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification74.4%

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -2 \cdot 10^{+205}:\\ \;\;\;\;-6 \cdot \left(x \cdot z\right)\\ \mathbf{elif}\;z \leq -1.22 \cdot 10^{+148}:\\ \;\;\;\;6 \cdot \left(y \cdot z\right)\\ \mathbf{elif}\;z \leq -7.8 \cdot 10^{+59}:\\ \;\;\;\;-6 \cdot \left(x \cdot z\right)\\ \mathbf{elif}\;z \leq -4.1 \cdot 10^{-38} \lor \neg \left(z \leq 2.05 \cdot 10^{-59}\right):\\ \;\;\;\;6 \cdot \left(y \cdot z\right)\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]

Alternative 3: 61.4% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := z \cdot \left(x \cdot -6\right)\\ t_1 := 6 \cdot \left(y \cdot z\right)\\ \mathbf{if}\;z \leq -1.05 \cdot 10^{+205}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;z \leq -8.5 \cdot 10^{+146}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq -2.05 \cdot 10^{+52}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;z \leq -7.5 \cdot 10^{-38} \lor \neg \left(z \leq 2.4 \cdot 10^{-60}\right):\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (let* ((t_0 (* z (* x -6.0))) (t_1 (* 6.0 (* y z))))
   (if (<= z -1.05e+205)
     t_0
     (if (<= z -8.5e+146)
       t_1
       (if (<= z -2.05e+52)
         t_0
         (if (or (<= z -7.5e-38) (not (<= z 2.4e-60))) t_1 x))))))
double code(double x, double y, double z) {
	double t_0 = z * (x * -6.0);
	double t_1 = 6.0 * (y * z);
	double tmp;
	if (z <= -1.05e+205) {
		tmp = t_0;
	} else if (z <= -8.5e+146) {
		tmp = t_1;
	} else if (z <= -2.05e+52) {
		tmp = t_0;
	} else if ((z <= -7.5e-38) || !(z <= 2.4e-60)) {
		tmp = t_1;
	} else {
		tmp = x;
	}
	return tmp;
}
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8) :: t_0
    real(8) :: t_1
    real(8) :: tmp
    t_0 = z * (x * (-6.0d0))
    t_1 = 6.0d0 * (y * z)
    if (z <= (-1.05d+205)) then
        tmp = t_0
    else if (z <= (-8.5d+146)) then
        tmp = t_1
    else if (z <= (-2.05d+52)) then
        tmp = t_0
    else if ((z <= (-7.5d-38)) .or. (.not. (z <= 2.4d-60))) then
        tmp = t_1
    else
        tmp = x
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double t_0 = z * (x * -6.0);
	double t_1 = 6.0 * (y * z);
	double tmp;
	if (z <= -1.05e+205) {
		tmp = t_0;
	} else if (z <= -8.5e+146) {
		tmp = t_1;
	} else if (z <= -2.05e+52) {
		tmp = t_0;
	} else if ((z <= -7.5e-38) || !(z <= 2.4e-60)) {
		tmp = t_1;
	} else {
		tmp = x;
	}
	return tmp;
}
def code(x, y, z):
	t_0 = z * (x * -6.0)
	t_1 = 6.0 * (y * z)
	tmp = 0
	if z <= -1.05e+205:
		tmp = t_0
	elif z <= -8.5e+146:
		tmp = t_1
	elif z <= -2.05e+52:
		tmp = t_0
	elif (z <= -7.5e-38) or not (z <= 2.4e-60):
		tmp = t_1
	else:
		tmp = x
	return tmp
function code(x, y, z)
	t_0 = Float64(z * Float64(x * -6.0))
	t_1 = Float64(6.0 * Float64(y * z))
	tmp = 0.0
	if (z <= -1.05e+205)
		tmp = t_0;
	elseif (z <= -8.5e+146)
		tmp = t_1;
	elseif (z <= -2.05e+52)
		tmp = t_0;
	elseif ((z <= -7.5e-38) || !(z <= 2.4e-60))
		tmp = t_1;
	else
		tmp = x;
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	t_0 = z * (x * -6.0);
	t_1 = 6.0 * (y * z);
	tmp = 0.0;
	if (z <= -1.05e+205)
		tmp = t_0;
	elseif (z <= -8.5e+146)
		tmp = t_1;
	elseif (z <= -2.05e+52)
		tmp = t_0;
	elseif ((z <= -7.5e-38) || ~((z <= 2.4e-60)))
		tmp = t_1;
	else
		tmp = x;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := Block[{t$95$0 = N[(z * N[(x * -6.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(6.0 * N[(y * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.05e+205], t$95$0, If[LessEqual[z, -8.5e+146], t$95$1, If[LessEqual[z, -2.05e+52], t$95$0, If[Or[LessEqual[z, -7.5e-38], N[Not[LessEqual[z, 2.4e-60]], $MachinePrecision]], t$95$1, x]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := z \cdot \left(x \cdot -6\right)\\
t_1 := 6 \cdot \left(y \cdot z\right)\\
\mathbf{if}\;z \leq -1.05 \cdot 10^{+205}:\\
\;\;\;\;t_0\\

\mathbf{elif}\;z \leq -8.5 \cdot 10^{+146}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;z \leq -2.05 \cdot 10^{+52}:\\
\;\;\;\;t_0\\

\mathbf{elif}\;z \leq -7.5 \cdot 10^{-38} \lor \neg \left(z \leq 2.4 \cdot 10^{-60}\right):\\
\;\;\;\;t_1\\

\mathbf{else}:\\
\;\;\;\;x\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -1.05e205 or -8.5e146 < z < -2.05e52

    1. Initial program 100.0%

      \[x + \left(\left(y - x\right) \cdot 6\right) \cdot z \]
    2. Step-by-step derivation
      1. associate-*r*99.8%

        \[\leadsto x + \color{blue}{\left(y - x\right) \cdot \left(6 \cdot z\right)} \]
      2. +-commutative99.8%

        \[\leadsto \color{blue}{\left(y - x\right) \cdot \left(6 \cdot z\right) + x} \]
      3. *-commutative99.8%

        \[\leadsto \left(y - x\right) \cdot \color{blue}{\left(z \cdot 6\right)} + x \]
      4. associate-*r*99.8%

        \[\leadsto \color{blue}{\left(\left(y - x\right) \cdot z\right) \cdot 6} + x \]
      5. fma-def99.8%

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

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

      \[\leadsto \color{blue}{6 \cdot \left(z \cdot \left(y - x\right)\right)} \]
    5. Step-by-step derivation
      1. associate-*r*99.8%

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

        \[\leadsto \color{blue}{\left(z \cdot 6\right)} \cdot \left(y - x\right) \]
      3. associate-*l*100.0%

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

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

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

    if -1.05e205 < z < -8.5e146 or -2.05e52 < z < -7.5e-38 or 2.40000000000000009e-60 < z

    1. Initial program 99.7%

      \[x + \left(\left(y - x\right) \cdot 6\right) \cdot z \]
    2. Step-by-step derivation
      1. associate-*r*99.7%

        \[\leadsto x + \color{blue}{\left(y - x\right) \cdot \left(6 \cdot z\right)} \]
      2. +-commutative99.7%

        \[\leadsto \color{blue}{\left(y - x\right) \cdot \left(6 \cdot z\right) + x} \]
      3. *-commutative99.7%

        \[\leadsto \left(y - x\right) \cdot \color{blue}{\left(z \cdot 6\right)} + x \]
      4. associate-*r*99.6%

        \[\leadsto \color{blue}{\left(\left(y - x\right) \cdot z\right) \cdot 6} + x \]
      5. fma-def99.7%

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

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

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

    if -7.5e-38 < z < 2.40000000000000009e-60

    1. Initial program 99.9%

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

      \[\leadsto \color{blue}{x} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification74.4%

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.05 \cdot 10^{+205}:\\ \;\;\;\;z \cdot \left(x \cdot -6\right)\\ \mathbf{elif}\;z \leq -8.5 \cdot 10^{+146}:\\ \;\;\;\;6 \cdot \left(y \cdot z\right)\\ \mathbf{elif}\;z \leq -2.05 \cdot 10^{+52}:\\ \;\;\;\;z \cdot \left(x \cdot -6\right)\\ \mathbf{elif}\;z \leq -7.5 \cdot 10^{-38} \lor \neg \left(z \leq 2.4 \cdot 10^{-60}\right):\\ \;\;\;\;6 \cdot \left(y \cdot z\right)\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]

Alternative 4: 61.5% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := z \cdot \left(x \cdot -6\right)\\ t_1 := z \cdot \left(y \cdot 6\right)\\ \mathbf{if}\;z \leq -6.6 \cdot 10^{+204}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;z \leq -8.5 \cdot 10^{+148}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq -4.8 \cdot 10^{+58}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;z \leq -9.2 \cdot 10^{-38}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq 2.7 \cdot 10^{-59}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;6 \cdot \left(y \cdot z\right)\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (let* ((t_0 (* z (* x -6.0))) (t_1 (* z (* y 6.0))))
   (if (<= z -6.6e+204)
     t_0
     (if (<= z -8.5e+148)
       t_1
       (if (<= z -4.8e+58)
         t_0
         (if (<= z -9.2e-38) t_1 (if (<= z 2.7e-59) x (* 6.0 (* y z)))))))))
double code(double x, double y, double z) {
	double t_0 = z * (x * -6.0);
	double t_1 = z * (y * 6.0);
	double tmp;
	if (z <= -6.6e+204) {
		tmp = t_0;
	} else if (z <= -8.5e+148) {
		tmp = t_1;
	} else if (z <= -4.8e+58) {
		tmp = t_0;
	} else if (z <= -9.2e-38) {
		tmp = t_1;
	} else if (z <= 2.7e-59) {
		tmp = x;
	} else {
		tmp = 6.0 * (y * z);
	}
	return tmp;
}
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8) :: t_0
    real(8) :: t_1
    real(8) :: tmp
    t_0 = z * (x * (-6.0d0))
    t_1 = z * (y * 6.0d0)
    if (z <= (-6.6d+204)) then
        tmp = t_0
    else if (z <= (-8.5d+148)) then
        tmp = t_1
    else if (z <= (-4.8d+58)) then
        tmp = t_0
    else if (z <= (-9.2d-38)) then
        tmp = t_1
    else if (z <= 2.7d-59) then
        tmp = x
    else
        tmp = 6.0d0 * (y * z)
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double t_0 = z * (x * -6.0);
	double t_1 = z * (y * 6.0);
	double tmp;
	if (z <= -6.6e+204) {
		tmp = t_0;
	} else if (z <= -8.5e+148) {
		tmp = t_1;
	} else if (z <= -4.8e+58) {
		tmp = t_0;
	} else if (z <= -9.2e-38) {
		tmp = t_1;
	} else if (z <= 2.7e-59) {
		tmp = x;
	} else {
		tmp = 6.0 * (y * z);
	}
	return tmp;
}
def code(x, y, z):
	t_0 = z * (x * -6.0)
	t_1 = z * (y * 6.0)
	tmp = 0
	if z <= -6.6e+204:
		tmp = t_0
	elif z <= -8.5e+148:
		tmp = t_1
	elif z <= -4.8e+58:
		tmp = t_0
	elif z <= -9.2e-38:
		tmp = t_1
	elif z <= 2.7e-59:
		tmp = x
	else:
		tmp = 6.0 * (y * z)
	return tmp
function code(x, y, z)
	t_0 = Float64(z * Float64(x * -6.0))
	t_1 = Float64(z * Float64(y * 6.0))
	tmp = 0.0
	if (z <= -6.6e+204)
		tmp = t_0;
	elseif (z <= -8.5e+148)
		tmp = t_1;
	elseif (z <= -4.8e+58)
		tmp = t_0;
	elseif (z <= -9.2e-38)
		tmp = t_1;
	elseif (z <= 2.7e-59)
		tmp = x;
	else
		tmp = Float64(6.0 * Float64(y * z));
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	t_0 = z * (x * -6.0);
	t_1 = z * (y * 6.0);
	tmp = 0.0;
	if (z <= -6.6e+204)
		tmp = t_0;
	elseif (z <= -8.5e+148)
		tmp = t_1;
	elseif (z <= -4.8e+58)
		tmp = t_0;
	elseif (z <= -9.2e-38)
		tmp = t_1;
	elseif (z <= 2.7e-59)
		tmp = x;
	else
		tmp = 6.0 * (y * z);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := Block[{t$95$0 = N[(z * N[(x * -6.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(z * N[(y * 6.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -6.6e+204], t$95$0, If[LessEqual[z, -8.5e+148], t$95$1, If[LessEqual[z, -4.8e+58], t$95$0, If[LessEqual[z, -9.2e-38], t$95$1, If[LessEqual[z, 2.7e-59], x, N[(6.0 * N[(y * z), $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := z \cdot \left(x \cdot -6\right)\\
t_1 := z \cdot \left(y \cdot 6\right)\\
\mathbf{if}\;z \leq -6.6 \cdot 10^{+204}:\\
\;\;\;\;t_0\\

\mathbf{elif}\;z \leq -8.5 \cdot 10^{+148}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;z \leq -4.8 \cdot 10^{+58}:\\
\;\;\;\;t_0\\

\mathbf{elif}\;z \leq -9.2 \cdot 10^{-38}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;z \leq 2.7 \cdot 10^{-59}:\\
\;\;\;\;x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -6.5999999999999995e204 or -8.4999999999999996e148 < z < -4.8e58

    1. Initial program 100.0%

      \[x + \left(\left(y - x\right) \cdot 6\right) \cdot z \]
    2. Step-by-step derivation
      1. associate-*r*99.8%

        \[\leadsto x + \color{blue}{\left(y - x\right) \cdot \left(6 \cdot z\right)} \]
      2. +-commutative99.8%

        \[\leadsto \color{blue}{\left(y - x\right) \cdot \left(6 \cdot z\right) + x} \]
      3. *-commutative99.8%

        \[\leadsto \left(y - x\right) \cdot \color{blue}{\left(z \cdot 6\right)} + x \]
      4. associate-*r*99.8%

        \[\leadsto \color{blue}{\left(\left(y - x\right) \cdot z\right) \cdot 6} + x \]
      5. fma-def99.8%

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

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

      \[\leadsto \color{blue}{6 \cdot \left(z \cdot \left(y - x\right)\right)} \]
    5. Step-by-step derivation
      1. associate-*r*99.8%

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

        \[\leadsto \color{blue}{\left(z \cdot 6\right)} \cdot \left(y - x\right) \]
      3. associate-*l*100.0%

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

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

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

    if -6.5999999999999995e204 < z < -8.4999999999999996e148 or -4.8e58 < z < -9.20000000000000007e-38

    1. Initial program 99.9%

      \[x + \left(\left(y - x\right) \cdot 6\right) \cdot z \]
    2. Step-by-step derivation
      1. associate-*r*99.7%

        \[\leadsto x + \color{blue}{\left(y - x\right) \cdot \left(6 \cdot z\right)} \]
      2. +-commutative99.7%

        \[\leadsto \color{blue}{\left(y - x\right) \cdot \left(6 \cdot z\right) + x} \]
      3. *-commutative99.7%

        \[\leadsto \left(y - x\right) \cdot \color{blue}{\left(z \cdot 6\right)} + x \]
      4. associate-*r*99.6%

        \[\leadsto \color{blue}{\left(\left(y - x\right) \cdot z\right) \cdot 6} + x \]
      5. fma-def99.7%

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

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

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

        \[\leadsto \color{blue}{\left(y \cdot z\right) \cdot 6} \]
      2. *-commutative72.1%

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

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

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

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

    if -9.20000000000000007e-38 < z < 2.6999999999999999e-59

    1. Initial program 99.9%

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

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

    if 2.6999999999999999e-59 < z

    1. Initial program 99.7%

      \[x + \left(\left(y - x\right) \cdot 6\right) \cdot z \]
    2. Step-by-step derivation
      1. associate-*r*99.7%

        \[\leadsto x + \color{blue}{\left(y - x\right) \cdot \left(6 \cdot z\right)} \]
      2. +-commutative99.7%

        \[\leadsto \color{blue}{\left(y - x\right) \cdot \left(6 \cdot z\right) + x} \]
      3. *-commutative99.7%

        \[\leadsto \left(y - x\right) \cdot \color{blue}{\left(z \cdot 6\right)} + x \]
      4. associate-*r*99.6%

        \[\leadsto \color{blue}{\left(\left(y - x\right) \cdot z\right) \cdot 6} + x \]
      5. fma-def99.7%

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

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

      \[\leadsto \color{blue}{6 \cdot \left(y \cdot z\right)} \]
  3. Recombined 4 regimes into one program.
  4. Final simplification74.5%

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -6.6 \cdot 10^{+204}:\\ \;\;\;\;z \cdot \left(x \cdot -6\right)\\ \mathbf{elif}\;z \leq -8.5 \cdot 10^{+148}:\\ \;\;\;\;z \cdot \left(y \cdot 6\right)\\ \mathbf{elif}\;z \leq -4.8 \cdot 10^{+58}:\\ \;\;\;\;z \cdot \left(x \cdot -6\right)\\ \mathbf{elif}\;z \leq -9.2 \cdot 10^{-38}:\\ \;\;\;\;z \cdot \left(y \cdot 6\right)\\ \mathbf{elif}\;z \leq 2.7 \cdot 10^{-59}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;6 \cdot \left(y \cdot z\right)\\ \end{array} \]

Alternative 5: 84.1% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -3.4 \cdot 10^{-38} \lor \neg \left(z \leq 8.5 \cdot 10^{-36}\right):\\ \;\;\;\;z \cdot \left(\left(y - x\right) \cdot 6\right)\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (if (or (<= z -3.4e-38) (not (<= z 8.5e-36))) (* z (* (- y x) 6.0)) x))
double code(double x, double y, double z) {
	double tmp;
	if ((z <= -3.4e-38) || !(z <= 8.5e-36)) {
		tmp = z * ((y - x) * 6.0);
	} else {
		tmp = x;
	}
	return tmp;
}
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8) :: tmp
    if ((z <= (-3.4d-38)) .or. (.not. (z <= 8.5d-36))) then
        tmp = z * ((y - x) * 6.0d0)
    else
        tmp = x
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double tmp;
	if ((z <= -3.4e-38) || !(z <= 8.5e-36)) {
		tmp = z * ((y - x) * 6.0);
	} else {
		tmp = x;
	}
	return tmp;
}
def code(x, y, z):
	tmp = 0
	if (z <= -3.4e-38) or not (z <= 8.5e-36):
		tmp = z * ((y - x) * 6.0)
	else:
		tmp = x
	return tmp
function code(x, y, z)
	tmp = 0.0
	if ((z <= -3.4e-38) || !(z <= 8.5e-36))
		tmp = Float64(z * Float64(Float64(y - x) * 6.0));
	else
		tmp = x;
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	tmp = 0.0;
	if ((z <= -3.4e-38) || ~((z <= 8.5e-36)))
		tmp = z * ((y - x) * 6.0);
	else
		tmp = x;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := If[Or[LessEqual[z, -3.4e-38], N[Not[LessEqual[z, 8.5e-36]], $MachinePrecision]], N[(z * N[(N[(y - x), $MachinePrecision] * 6.0), $MachinePrecision]), $MachinePrecision], x]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.4 \cdot 10^{-38} \lor \neg \left(z \leq 8.5 \cdot 10^{-36}\right):\\
\;\;\;\;z \cdot \left(\left(y - x\right) \cdot 6\right)\\

\mathbf{else}:\\
\;\;\;\;x\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -3.4000000000000002e-38 or 8.5000000000000007e-36 < z

    1. Initial program 99.8%

      \[x + \left(\left(y - x\right) \cdot 6\right) \cdot z \]
    2. Step-by-step derivation
      1. associate-*r*99.8%

        \[\leadsto x + \color{blue}{\left(y - x\right) \cdot \left(6 \cdot z\right)} \]
      2. +-commutative99.8%

        \[\leadsto \color{blue}{\left(y - x\right) \cdot \left(6 \cdot z\right) + x} \]
      3. *-commutative99.8%

        \[\leadsto \left(y - x\right) \cdot \color{blue}{\left(z \cdot 6\right)} + x \]
      4. associate-*r*99.7%

        \[\leadsto \color{blue}{\left(\left(y - x\right) \cdot z\right) \cdot 6} + x \]
      5. fma-def99.7%

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

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

      \[\leadsto \color{blue}{6 \cdot \left(z \cdot \left(y - x\right)\right)} \]
    5. Step-by-step derivation
      1. associate-*r*95.7%

        \[\leadsto \color{blue}{\left(6 \cdot z\right) \cdot \left(y - x\right)} \]
      2. *-commutative95.7%

        \[\leadsto \color{blue}{\left(z \cdot 6\right)} \cdot \left(y - x\right) \]
      3. associate-*l*95.8%

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

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

    if -3.4000000000000002e-38 < z < 8.5000000000000007e-36

    1. Initial program 99.9%

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

      \[\leadsto \color{blue}{x} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification90.6%

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -3.4 \cdot 10^{-38} \lor \neg \left(z \leq 8.5 \cdot 10^{-36}\right):\\ \;\;\;\;z \cdot \left(\left(y - x\right) \cdot 6\right)\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]

Alternative 6: 84.1% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -8.4 \cdot 10^{-38}:\\ \;\;\;\;z \cdot \left(\left(y - x\right) \cdot 6\right)\\ \mathbf{elif}\;z \leq 4.6 \cdot 10^{-36}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;\left(y - x\right) \cdot \left(6 \cdot z\right)\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (if (<= z -8.4e-38)
   (* z (* (- y x) 6.0))
   (if (<= z 4.6e-36) x (* (- y x) (* 6.0 z)))))
double code(double x, double y, double z) {
	double tmp;
	if (z <= -8.4e-38) {
		tmp = z * ((y - x) * 6.0);
	} else if (z <= 4.6e-36) {
		tmp = x;
	} else {
		tmp = (y - x) * (6.0 * z);
	}
	return tmp;
}
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8) :: tmp
    if (z <= (-8.4d-38)) then
        tmp = z * ((y - x) * 6.0d0)
    else if (z <= 4.6d-36) then
        tmp = x
    else
        tmp = (y - x) * (6.0d0 * z)
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double tmp;
	if (z <= -8.4e-38) {
		tmp = z * ((y - x) * 6.0);
	} else if (z <= 4.6e-36) {
		tmp = x;
	} else {
		tmp = (y - x) * (6.0 * z);
	}
	return tmp;
}
def code(x, y, z):
	tmp = 0
	if z <= -8.4e-38:
		tmp = z * ((y - x) * 6.0)
	elif z <= 4.6e-36:
		tmp = x
	else:
		tmp = (y - x) * (6.0 * z)
	return tmp
function code(x, y, z)
	tmp = 0.0
	if (z <= -8.4e-38)
		tmp = Float64(z * Float64(Float64(y - x) * 6.0));
	elseif (z <= 4.6e-36)
		tmp = x;
	else
		tmp = Float64(Float64(y - x) * Float64(6.0 * z));
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	tmp = 0.0;
	if (z <= -8.4e-38)
		tmp = z * ((y - x) * 6.0);
	elseif (z <= 4.6e-36)
		tmp = x;
	else
		tmp = (y - x) * (6.0 * z);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := If[LessEqual[z, -8.4e-38], N[(z * N[(N[(y - x), $MachinePrecision] * 6.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 4.6e-36], x, N[(N[(y - x), $MachinePrecision] * N[(6.0 * z), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

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

\mathbf{elif}\;z \leq 4.6 \cdot 10^{-36}:\\
\;\;\;\;x\\

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


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

    1. Initial program 100.0%

      \[x + \left(\left(y - x\right) \cdot 6\right) \cdot z \]
    2. Step-by-step derivation
      1. associate-*r*99.8%

        \[\leadsto x + \color{blue}{\left(y - x\right) \cdot \left(6 \cdot z\right)} \]
      2. +-commutative99.8%

        \[\leadsto \color{blue}{\left(y - x\right) \cdot \left(6 \cdot z\right) + x} \]
      3. *-commutative99.8%

        \[\leadsto \left(y - x\right) \cdot \color{blue}{\left(z \cdot 6\right)} + x \]
      4. associate-*r*99.7%

        \[\leadsto \color{blue}{\left(\left(y - x\right) \cdot z\right) \cdot 6} + x \]
      5. fma-def99.8%

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

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

      \[\leadsto \color{blue}{6 \cdot \left(z \cdot \left(y - x\right)\right)} \]
    5. Step-by-step derivation
      1. associate-*r*97.2%

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

        \[\leadsto \color{blue}{\left(z \cdot 6\right)} \cdot \left(y - x\right) \]
      3. associate-*l*97.4%

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

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

    if -8.40000000000000052e-38 < z < 4.59999999999999993e-36

    1. Initial program 99.9%

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

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

    if 4.59999999999999993e-36 < z

    1. Initial program 99.7%

      \[x + \left(\left(y - x\right) \cdot 6\right) \cdot z \]
    2. Step-by-step derivation
      1. associate-*r*99.7%

        \[\leadsto x + \color{blue}{\left(y - x\right) \cdot \left(6 \cdot z\right)} \]
      2. +-commutative99.7%

        \[\leadsto \color{blue}{\left(y - x\right) \cdot \left(6 \cdot z\right) + x} \]
      3. *-commutative99.7%

        \[\leadsto \left(y - x\right) \cdot \color{blue}{\left(z \cdot 6\right)} + x \]
      4. associate-*r*99.6%

        \[\leadsto \color{blue}{\left(\left(y - x\right) \cdot z\right) \cdot 6} + x \]
      5. fma-def99.7%

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

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

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

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

        \[\leadsto \color{blue}{\left(\left(y - x\right) \cdot z\right) \cdot 6} \]
      3. associate-*r*94.3%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -8.4 \cdot 10^{-38}:\\ \;\;\;\;z \cdot \left(\left(y - x\right) \cdot 6\right)\\ \mathbf{elif}\;z \leq 4.6 \cdot 10^{-36}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;\left(y - x\right) \cdot \left(6 \cdot z\right)\\ \end{array} \]

Alternative 7: 98.7% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -9 \cdot 10^{-5}:\\ \;\;\;\;z \cdot \left(\left(y - x\right) \cdot 6\right)\\ \mathbf{elif}\;z \leq 0.17:\\ \;\;\;\;x + 6 \cdot \left(y \cdot z\right)\\ \mathbf{else}:\\ \;\;\;\;\left(y - x\right) \cdot \left(6 \cdot z\right)\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (if (<= z -9e-5)
   (* z (* (- y x) 6.0))
   (if (<= z 0.17) (+ x (* 6.0 (* y z))) (* (- y x) (* 6.0 z)))))
double code(double x, double y, double z) {
	double tmp;
	if (z <= -9e-5) {
		tmp = z * ((y - x) * 6.0);
	} else if (z <= 0.17) {
		tmp = x + (6.0 * (y * z));
	} else {
		tmp = (y - x) * (6.0 * z);
	}
	return tmp;
}
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8) :: tmp
    if (z <= (-9d-5)) then
        tmp = z * ((y - x) * 6.0d0)
    else if (z <= 0.17d0) then
        tmp = x + (6.0d0 * (y * z))
    else
        tmp = (y - x) * (6.0d0 * z)
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double tmp;
	if (z <= -9e-5) {
		tmp = z * ((y - x) * 6.0);
	} else if (z <= 0.17) {
		tmp = x + (6.0 * (y * z));
	} else {
		tmp = (y - x) * (6.0 * z);
	}
	return tmp;
}
def code(x, y, z):
	tmp = 0
	if z <= -9e-5:
		tmp = z * ((y - x) * 6.0)
	elif z <= 0.17:
		tmp = x + (6.0 * (y * z))
	else:
		tmp = (y - x) * (6.0 * z)
	return tmp
function code(x, y, z)
	tmp = 0.0
	if (z <= -9e-5)
		tmp = Float64(z * Float64(Float64(y - x) * 6.0));
	elseif (z <= 0.17)
		tmp = Float64(x + Float64(6.0 * Float64(y * z)));
	else
		tmp = Float64(Float64(y - x) * Float64(6.0 * z));
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	tmp = 0.0;
	if (z <= -9e-5)
		tmp = z * ((y - x) * 6.0);
	elseif (z <= 0.17)
		tmp = x + (6.0 * (y * z));
	else
		tmp = (y - x) * (6.0 * z);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := If[LessEqual[z, -9e-5], N[(z * N[(N[(y - x), $MachinePrecision] * 6.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 0.17], N[(x + N[(6.0 * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y - x), $MachinePrecision] * N[(6.0 * z), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

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

\mathbf{elif}\;z \leq 0.17:\\
\;\;\;\;x + 6 \cdot \left(y \cdot z\right)\\

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


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

    1. Initial program 100.0%

      \[x + \left(\left(y - x\right) \cdot 6\right) \cdot z \]
    2. Step-by-step derivation
      1. associate-*r*99.8%

        \[\leadsto x + \color{blue}{\left(y - x\right) \cdot \left(6 \cdot z\right)} \]
      2. +-commutative99.8%

        \[\leadsto \color{blue}{\left(y - x\right) \cdot \left(6 \cdot z\right) + x} \]
      3. *-commutative99.8%

        \[\leadsto \left(y - x\right) \cdot \color{blue}{\left(z \cdot 6\right)} + x \]
      4. associate-*r*99.7%

        \[\leadsto \color{blue}{\left(\left(y - x\right) \cdot z\right) \cdot 6} + x \]
      5. fma-def99.8%

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

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

      \[\leadsto \color{blue}{6 \cdot \left(z \cdot \left(y - x\right)\right)} \]
    5. Step-by-step derivation
      1. associate-*r*99.8%

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

        \[\leadsto \color{blue}{\left(z \cdot 6\right)} \cdot \left(y - x\right) \]
      3. associate-*l*100.0%

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

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

    if -9.00000000000000057e-5 < z < 0.170000000000000012

    1. Initial program 99.9%

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

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

    if 0.170000000000000012 < z

    1. Initial program 99.7%

      \[x + \left(\left(y - x\right) \cdot 6\right) \cdot z \]
    2. Step-by-step derivation
      1. associate-*r*99.7%

        \[\leadsto x + \color{blue}{\left(y - x\right) \cdot \left(6 \cdot z\right)} \]
      2. +-commutative99.7%

        \[\leadsto \color{blue}{\left(y - x\right) \cdot \left(6 \cdot z\right) + x} \]
      3. *-commutative99.7%

        \[\leadsto \left(y - x\right) \cdot \color{blue}{\left(z \cdot 6\right)} + x \]
      4. associate-*r*99.6%

        \[\leadsto \color{blue}{\left(\left(y - x\right) \cdot z\right) \cdot 6} + x \]
      5. fma-def99.7%

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

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

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

        \[\leadsto 6 \cdot \color{blue}{\left(\left(y - x\right) \cdot z\right)} \]
      2. *-commutative99.5%

        \[\leadsto \color{blue}{\left(\left(y - x\right) \cdot z\right) \cdot 6} \]
      3. associate-*r*99.6%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -9 \cdot 10^{-5}:\\ \;\;\;\;z \cdot \left(\left(y - x\right) \cdot 6\right)\\ \mathbf{elif}\;z \leq 0.17:\\ \;\;\;\;x + 6 \cdot \left(y \cdot z\right)\\ \mathbf{else}:\\ \;\;\;\;\left(y - x\right) \cdot \left(6 \cdot z\right)\\ \end{array} \]

Alternative 8: 98.3% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -2.65 \cdot 10^{+20}:\\ \;\;\;\;z \cdot \left(\left(y - x\right) \cdot 6\right)\\ \mathbf{elif}\;z \leq 13500:\\ \;\;\;\;x + z \cdot \left(y \cdot 6\right)\\ \mathbf{else}:\\ \;\;\;\;\left(y - x\right) \cdot \left(6 \cdot z\right)\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (if (<= z -2.65e+20)
   (* z (* (- y x) 6.0))
   (if (<= z 13500.0) (+ x (* z (* y 6.0))) (* (- y x) (* 6.0 z)))))
double code(double x, double y, double z) {
	double tmp;
	if (z <= -2.65e+20) {
		tmp = z * ((y - x) * 6.0);
	} else if (z <= 13500.0) {
		tmp = x + (z * (y * 6.0));
	} else {
		tmp = (y - x) * (6.0 * z);
	}
	return tmp;
}
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8) :: tmp
    if (z <= (-2.65d+20)) then
        tmp = z * ((y - x) * 6.0d0)
    else if (z <= 13500.0d0) then
        tmp = x + (z * (y * 6.0d0))
    else
        tmp = (y - x) * (6.0d0 * z)
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double tmp;
	if (z <= -2.65e+20) {
		tmp = z * ((y - x) * 6.0);
	} else if (z <= 13500.0) {
		tmp = x + (z * (y * 6.0));
	} else {
		tmp = (y - x) * (6.0 * z);
	}
	return tmp;
}
def code(x, y, z):
	tmp = 0
	if z <= -2.65e+20:
		tmp = z * ((y - x) * 6.0)
	elif z <= 13500.0:
		tmp = x + (z * (y * 6.0))
	else:
		tmp = (y - x) * (6.0 * z)
	return tmp
function code(x, y, z)
	tmp = 0.0
	if (z <= -2.65e+20)
		tmp = Float64(z * Float64(Float64(y - x) * 6.0));
	elseif (z <= 13500.0)
		tmp = Float64(x + Float64(z * Float64(y * 6.0)));
	else
		tmp = Float64(Float64(y - x) * Float64(6.0 * z));
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	tmp = 0.0;
	if (z <= -2.65e+20)
		tmp = z * ((y - x) * 6.0);
	elseif (z <= 13500.0)
		tmp = x + (z * (y * 6.0));
	else
		tmp = (y - x) * (6.0 * z);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := If[LessEqual[z, -2.65e+20], N[(z * N[(N[(y - x), $MachinePrecision] * 6.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 13500.0], N[(x + N[(z * N[(y * 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y - x), $MachinePrecision] * N[(6.0 * z), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.65 \cdot 10^{+20}:\\
\;\;\;\;z \cdot \left(\left(y - x\right) \cdot 6\right)\\

\mathbf{elif}\;z \leq 13500:\\
\;\;\;\;x + z \cdot \left(y \cdot 6\right)\\

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


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

    1. Initial program 99.9%

      \[x + \left(\left(y - x\right) \cdot 6\right) \cdot z \]
    2. Step-by-step derivation
      1. associate-*r*99.8%

        \[\leadsto x + \color{blue}{\left(y - x\right) \cdot \left(6 \cdot z\right)} \]
      2. +-commutative99.8%

        \[\leadsto \color{blue}{\left(y - x\right) \cdot \left(6 \cdot z\right) + x} \]
      3. *-commutative99.8%

        \[\leadsto \left(y - x\right) \cdot \color{blue}{\left(z \cdot 6\right)} + x \]
      4. associate-*r*99.7%

        \[\leadsto \color{blue}{\left(\left(y - x\right) \cdot z\right) \cdot 6} + x \]
      5. fma-def99.8%

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

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

      \[\leadsto \color{blue}{6 \cdot \left(z \cdot \left(y - x\right)\right)} \]
    5. Step-by-step derivation
      1. associate-*r*99.8%

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

        \[\leadsto \color{blue}{\left(z \cdot 6\right)} \cdot \left(y - x\right) \]
      3. associate-*l*99.9%

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

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

    if -2.65e20 < z < 13500

    1. Initial program 99.9%

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

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

    if 13500 < z

    1. Initial program 99.7%

      \[x + \left(\left(y - x\right) \cdot 6\right) \cdot z \]
    2. Step-by-step derivation
      1. associate-*r*99.7%

        \[\leadsto x + \color{blue}{\left(y - x\right) \cdot \left(6 \cdot z\right)} \]
      2. +-commutative99.7%

        \[\leadsto \color{blue}{\left(y - x\right) \cdot \left(6 \cdot z\right) + x} \]
      3. *-commutative99.7%

        \[\leadsto \left(y - x\right) \cdot \color{blue}{\left(z \cdot 6\right)} + x \]
      4. associate-*r*99.6%

        \[\leadsto \color{blue}{\left(\left(y - x\right) \cdot z\right) \cdot 6} + x \]
      5. fma-def99.7%

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

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

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

        \[\leadsto 6 \cdot \color{blue}{\left(\left(y - x\right) \cdot z\right)} \]
      2. *-commutative99.5%

        \[\leadsto \color{blue}{\left(\left(y - x\right) \cdot z\right) \cdot 6} \]
      3. associate-*r*99.6%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -2.65 \cdot 10^{+20}:\\ \;\;\;\;z \cdot \left(\left(y - x\right) \cdot 6\right)\\ \mathbf{elif}\;z \leq 13500:\\ \;\;\;\;x + z \cdot \left(y \cdot 6\right)\\ \mathbf{else}:\\ \;\;\;\;\left(y - x\right) \cdot \left(6 \cdot z\right)\\ \end{array} \]

Alternative 9: 60.5% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -2.65 \cdot 10^{+20} \lor \neg \left(z \leq 50000000\right):\\ \;\;\;\;-6 \cdot \left(x \cdot z\right)\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (if (or (<= z -2.65e+20) (not (<= z 50000000.0))) (* -6.0 (* x z)) x))
double code(double x, double y, double z) {
	double tmp;
	if ((z <= -2.65e+20) || !(z <= 50000000.0)) {
		tmp = -6.0 * (x * z);
	} else {
		tmp = x;
	}
	return tmp;
}
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8) :: tmp
    if ((z <= (-2.65d+20)) .or. (.not. (z <= 50000000.0d0))) then
        tmp = (-6.0d0) * (x * z)
    else
        tmp = x
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double tmp;
	if ((z <= -2.65e+20) || !(z <= 50000000.0)) {
		tmp = -6.0 * (x * z);
	} else {
		tmp = x;
	}
	return tmp;
}
def code(x, y, z):
	tmp = 0
	if (z <= -2.65e+20) or not (z <= 50000000.0):
		tmp = -6.0 * (x * z)
	else:
		tmp = x
	return tmp
function code(x, y, z)
	tmp = 0.0
	if ((z <= -2.65e+20) || !(z <= 50000000.0))
		tmp = Float64(-6.0 * Float64(x * z));
	else
		tmp = x;
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	tmp = 0.0;
	if ((z <= -2.65e+20) || ~((z <= 50000000.0)))
		tmp = -6.0 * (x * z);
	else
		tmp = x;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := If[Or[LessEqual[z, -2.65e+20], N[Not[LessEqual[z, 50000000.0]], $MachinePrecision]], N[(-6.0 * N[(x * z), $MachinePrecision]), $MachinePrecision], x]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.65 \cdot 10^{+20} \lor \neg \left(z \leq 50000000\right):\\
\;\;\;\;-6 \cdot \left(x \cdot z\right)\\

\mathbf{else}:\\
\;\;\;\;x\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -2.65e20 or 5e7 < z

    1. Initial program 99.8%

      \[x + \left(\left(y - x\right) \cdot 6\right) \cdot z \]
    2. Step-by-step derivation
      1. associate-*r*99.8%

        \[\leadsto x + \color{blue}{\left(y - x\right) \cdot \left(6 \cdot z\right)} \]
      2. +-commutative99.8%

        \[\leadsto \color{blue}{\left(y - x\right) \cdot \left(6 \cdot z\right) + x} \]
      3. *-commutative99.8%

        \[\leadsto \left(y - x\right) \cdot \color{blue}{\left(z \cdot 6\right)} + x \]
      4. associate-*r*99.7%

        \[\leadsto \color{blue}{\left(\left(y - x\right) \cdot z\right) \cdot 6} + x \]
      5. fma-def99.8%

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

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

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

        \[\leadsto 6 \cdot \color{blue}{\left(\left(y - x\right) \cdot z\right)} \]
      2. *-commutative99.7%

        \[\leadsto \color{blue}{\left(\left(y - x\right) \cdot z\right) \cdot 6} \]
      3. associate-*r*99.7%

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

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

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

    if -2.65e20 < z < 5e7

    1. Initial program 99.9%

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

      \[\leadsto \color{blue}{x} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification62.1%

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -2.65 \cdot 10^{+20} \lor \neg \left(z \leq 50000000\right):\\ \;\;\;\;-6 \cdot \left(x \cdot z\right)\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]

Alternative 10: 37.3% accurate, 9.0× speedup?

\[\begin{array}{l} \\ x \end{array} \]
(FPCore (x y z) :precision binary64 x)
double code(double x, double y, double z) {
	return x;
}
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    code = x
end function
public static double code(double x, double y, double z) {
	return x;
}
def code(x, y, z):
	return x
function code(x, y, z)
	return x
end
function tmp = code(x, y, z)
	tmp = x;
end
code[x_, y_, z_] := x
\begin{array}{l}

\\
x
\end{array}
Derivation
  1. Initial program 99.9%

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

    \[\leadsto \color{blue}{x} \]
  3. Final simplification39.6%

    \[\leadsto x \]

Developer target: 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));
}
real(8) function code(x, y, z)
    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 2023224 
(FPCore (x y z)
  :name "Data.Colour.RGBSpace.HSL:hsl from colour-2.3.3, E"
  :precision binary64

  :herbie-target
  (- x (* (* 6.0 z) (- x y)))

  (+ x (* (* (- y x) 6.0) z)))