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

Percentage Accurate: 99.5% → 99.7%
Time: 10.4s
Alternatives: 12
Speedup: 1.2×

Specification

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

\\
x + \left(\left(y - x\right) \cdot 6\right) \cdot \left(\frac{2}{3} - z\right)
\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 12 alternatives:

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

Initial Program: 99.5% accurate, 1.0× speedup?

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

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

Alternative 1: 99.7% accurate, 0.9× speedup?

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

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

    \[x + \left(\left(y - x\right) \cdot 6\right) \cdot \left(\frac{2}{3} - z\right) \]
  2. Step-by-step derivation
    1. metadata-eval99.6%

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

    \[\leadsto \color{blue}{x + \left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right)} \]
  4. Add Preprocessing
  5. Taylor expanded in z around 0 99.8%

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

    \[\leadsto x + \left(-6 \cdot \left(z \cdot \left(y - x\right)\right) + \left(y - x\right) \cdot 4\right) \]
  7. Add Preprocessing

Alternative 2: 73.9% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := -6 \cdot \left(z \cdot \left(y - x\right)\right)\\ \mathbf{if}\;z \leq -6.2 \cdot 10^{-12}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;z \leq -6.4 \cdot 10^{-260}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq -2.5 \cdot 10^{-288}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 0.5:\\ \;\;\;\;x \cdot -3\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (let* ((t_0 (* -6.0 (* z (- y x)))))
   (if (<= z -6.2e-12)
     t_0
     (if (<= z -6.4e-260)
       (* x -3.0)
       (if (<= z -2.5e-288) (* y 4.0) (if (<= z 0.5) (* x -3.0) t_0))))))
double code(double x, double y, double z) {
	double t_0 = -6.0 * (z * (y - x));
	double tmp;
	if (z <= -6.2e-12) {
		tmp = t_0;
	} else if (z <= -6.4e-260) {
		tmp = x * -3.0;
	} else if (z <= -2.5e-288) {
		tmp = y * 4.0;
	} else if (z <= 0.5) {
		tmp = x * -3.0;
	} else {
		tmp = t_0;
	}
	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) :: tmp
    t_0 = (-6.0d0) * (z * (y - x))
    if (z <= (-6.2d-12)) then
        tmp = t_0
    else if (z <= (-6.4d-260)) then
        tmp = x * (-3.0d0)
    else if (z <= (-2.5d-288)) then
        tmp = y * 4.0d0
    else if (z <= 0.5d0) then
        tmp = x * (-3.0d0)
    else
        tmp = t_0
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double t_0 = -6.0 * (z * (y - x));
	double tmp;
	if (z <= -6.2e-12) {
		tmp = t_0;
	} else if (z <= -6.4e-260) {
		tmp = x * -3.0;
	} else if (z <= -2.5e-288) {
		tmp = y * 4.0;
	} else if (z <= 0.5) {
		tmp = x * -3.0;
	} else {
		tmp = t_0;
	}
	return tmp;
}
def code(x, y, z):
	t_0 = -6.0 * (z * (y - x))
	tmp = 0
	if z <= -6.2e-12:
		tmp = t_0
	elif z <= -6.4e-260:
		tmp = x * -3.0
	elif z <= -2.5e-288:
		tmp = y * 4.0
	elif z <= 0.5:
		tmp = x * -3.0
	else:
		tmp = t_0
	return tmp
function code(x, y, z)
	t_0 = Float64(-6.0 * Float64(z * Float64(y - x)))
	tmp = 0.0
	if (z <= -6.2e-12)
		tmp = t_0;
	elseif (z <= -6.4e-260)
		tmp = Float64(x * -3.0);
	elseif (z <= -2.5e-288)
		tmp = Float64(y * 4.0);
	elseif (z <= 0.5)
		tmp = Float64(x * -3.0);
	else
		tmp = t_0;
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	t_0 = -6.0 * (z * (y - x));
	tmp = 0.0;
	if (z <= -6.2e-12)
		tmp = t_0;
	elseif (z <= -6.4e-260)
		tmp = x * -3.0;
	elseif (z <= -2.5e-288)
		tmp = y * 4.0;
	elseif (z <= 0.5)
		tmp = x * -3.0;
	else
		tmp = t_0;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := Block[{t$95$0 = N[(-6.0 * N[(z * N[(y - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -6.2e-12], t$95$0, If[LessEqual[z, -6.4e-260], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, -2.5e-288], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 0.5], N[(x * -3.0), $MachinePrecision], t$95$0]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := -6 \cdot \left(z \cdot \left(y - x\right)\right)\\
\mathbf{if}\;z \leq -6.2 \cdot 10^{-12}:\\
\;\;\;\;t\_0\\

\mathbf{elif}\;z \leq -6.4 \cdot 10^{-260}:\\
\;\;\;\;x \cdot -3\\

\mathbf{elif}\;z \leq -2.5 \cdot 10^{-288}:\\
\;\;\;\;y \cdot 4\\

\mathbf{elif}\;z \leq 0.5:\\
\;\;\;\;x \cdot -3\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -6.2000000000000002e-12 or 0.5 < z

    1. Initial program 99.7%

      \[x + \left(\left(y - x\right) \cdot 6\right) \cdot \left(\frac{2}{3} - z\right) \]
    2. Step-by-step derivation
      1. metadata-eval99.7%

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

      \[\leadsto \color{blue}{x + \left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in z around 0 99.8%

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

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

    if -6.2000000000000002e-12 < z < -6.3999999999999999e-260 or -2.50000000000000005e-288 < z < 0.5

    1. Initial program 99.4%

      \[x + \left(\left(y - x\right) \cdot 6\right) \cdot \left(\frac{2}{3} - z\right) \]
    2. Step-by-step derivation
      1. metadata-eval99.4%

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

      \[\leadsto \color{blue}{x + \left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in z around 0 99.7%

      \[\leadsto x + \color{blue}{4 \cdot \left(y - x\right)} \]
    6. Taylor expanded in x around inf 58.1%

      \[\leadsto \color{blue}{-3 \cdot x} \]
    7. Step-by-step derivation
      1. *-commutative58.1%

        \[\leadsto \color{blue}{x \cdot -3} \]
    8. Simplified58.1%

      \[\leadsto \color{blue}{x \cdot -3} \]

    if -6.3999999999999999e-260 < z < -2.50000000000000005e-288

    1. Initial program 99.4%

      \[x + \left(\left(y - x\right) \cdot 6\right) \cdot \left(\frac{2}{3} - z\right) \]
    2. Step-by-step derivation
      1. metadata-eval99.4%

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

      \[\leadsto \color{blue}{x + \left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in z around 0 99.9%

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

      \[\leadsto \color{blue}{4 \cdot y} \]
    7. Step-by-step derivation
      1. *-commutative79.2%

        \[\leadsto \color{blue}{y \cdot 4} \]
    8. Simplified79.2%

      \[\leadsto \color{blue}{y \cdot 4} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification76.9%

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -6.2 \cdot 10^{-12}:\\ \;\;\;\;-6 \cdot \left(z \cdot \left(y - x\right)\right)\\ \mathbf{elif}\;z \leq -6.4 \cdot 10^{-260}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq -2.5 \cdot 10^{-288}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 0.5:\\ \;\;\;\;x \cdot -3\\ \mathbf{else}:\\ \;\;\;\;-6 \cdot \left(z \cdot \left(y - x\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 74.8% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := x \cdot \left(z \cdot 6 - 3\right)\\ t_1 := -6 \cdot \left(z \cdot \left(y - x\right)\right)\\ \mathbf{if}\;z \leq -440000:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq -1.04 \cdot 10^{-259}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;z \leq -4.5 \cdot 10^{-290}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 136000:\\ \;\;\;\;t\_0\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (let* ((t_0 (* x (- (* z 6.0) 3.0))) (t_1 (* -6.0 (* z (- y x)))))
   (if (<= z -440000.0)
     t_1
     (if (<= z -1.04e-259)
       t_0
       (if (<= z -4.5e-290) (* y 4.0) (if (<= z 136000.0) t_0 t_1))))))
double code(double x, double y, double z) {
	double t_0 = x * ((z * 6.0) - 3.0);
	double t_1 = -6.0 * (z * (y - x));
	double tmp;
	if (z <= -440000.0) {
		tmp = t_1;
	} else if (z <= -1.04e-259) {
		tmp = t_0;
	} else if (z <= -4.5e-290) {
		tmp = y * 4.0;
	} else if (z <= 136000.0) {
		tmp = t_0;
	} else {
		tmp = t_1;
	}
	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 = x * ((z * 6.0d0) - 3.0d0)
    t_1 = (-6.0d0) * (z * (y - x))
    if (z <= (-440000.0d0)) then
        tmp = t_1
    else if (z <= (-1.04d-259)) then
        tmp = t_0
    else if (z <= (-4.5d-290)) then
        tmp = y * 4.0d0
    else if (z <= 136000.0d0) then
        tmp = t_0
    else
        tmp = t_1
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double t_0 = x * ((z * 6.0) - 3.0);
	double t_1 = -6.0 * (z * (y - x));
	double tmp;
	if (z <= -440000.0) {
		tmp = t_1;
	} else if (z <= -1.04e-259) {
		tmp = t_0;
	} else if (z <= -4.5e-290) {
		tmp = y * 4.0;
	} else if (z <= 136000.0) {
		tmp = t_0;
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z):
	t_0 = x * ((z * 6.0) - 3.0)
	t_1 = -6.0 * (z * (y - x))
	tmp = 0
	if z <= -440000.0:
		tmp = t_1
	elif z <= -1.04e-259:
		tmp = t_0
	elif z <= -4.5e-290:
		tmp = y * 4.0
	elif z <= 136000.0:
		tmp = t_0
	else:
		tmp = t_1
	return tmp
function code(x, y, z)
	t_0 = Float64(x * Float64(Float64(z * 6.0) - 3.0))
	t_1 = Float64(-6.0 * Float64(z * Float64(y - x)))
	tmp = 0.0
	if (z <= -440000.0)
		tmp = t_1;
	elseif (z <= -1.04e-259)
		tmp = t_0;
	elseif (z <= -4.5e-290)
		tmp = Float64(y * 4.0);
	elseif (z <= 136000.0)
		tmp = t_0;
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	t_0 = x * ((z * 6.0) - 3.0);
	t_1 = -6.0 * (z * (y - x));
	tmp = 0.0;
	if (z <= -440000.0)
		tmp = t_1;
	elseif (z <= -1.04e-259)
		tmp = t_0;
	elseif (z <= -4.5e-290)
		tmp = y * 4.0;
	elseif (z <= 136000.0)
		tmp = t_0;
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := Block[{t$95$0 = N[(x * N[(N[(z * 6.0), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(-6.0 * N[(z * N[(y - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -440000.0], t$95$1, If[LessEqual[z, -1.04e-259], t$95$0, If[LessEqual[z, -4.5e-290], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 136000.0], t$95$0, t$95$1]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := x \cdot \left(z \cdot 6 - 3\right)\\
t_1 := -6 \cdot \left(z \cdot \left(y - x\right)\right)\\
\mathbf{if}\;z \leq -440000:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;z \leq -1.04 \cdot 10^{-259}:\\
\;\;\;\;t\_0\\

\mathbf{elif}\;z \leq -4.5 \cdot 10^{-290}:\\
\;\;\;\;y \cdot 4\\

\mathbf{elif}\;z \leq 136000:\\
\;\;\;\;t\_0\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -4.4e5 or 136000 < z

    1. Initial program 99.8%

      \[x + \left(\left(y - x\right) \cdot 6\right) \cdot \left(\frac{2}{3} - z\right) \]
    2. Step-by-step derivation
      1. metadata-eval99.8%

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

      \[\leadsto \color{blue}{x + \left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in z around 0 99.8%

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

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

    if -4.4e5 < z < -1.03999999999999997e-259 or -4.5e-290 < z < 136000

    1. Initial program 99.4%

      \[x + \left(\left(y - x\right) \cdot 6\right) \cdot \left(\frac{2}{3} - z\right) \]
    2. Step-by-step derivation
      1. metadata-eval99.4%

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

      \[\leadsto \color{blue}{x + \left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in z around 0 99.8%

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

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

    if -1.03999999999999997e-259 < z < -4.5e-290

    1. Initial program 99.4%

      \[x + \left(\left(y - x\right) \cdot 6\right) \cdot \left(\frac{2}{3} - z\right) \]
    2. Step-by-step derivation
      1. metadata-eval99.4%

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

      \[\leadsto \color{blue}{x + \left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in z around 0 99.9%

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

      \[\leadsto \color{blue}{4 \cdot y} \]
    7. Step-by-step derivation
      1. *-commutative79.2%

        \[\leadsto \color{blue}{y \cdot 4} \]
    8. Simplified79.2%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -440000:\\ \;\;\;\;-6 \cdot \left(z \cdot \left(y - x\right)\right)\\ \mathbf{elif}\;z \leq -1.04 \cdot 10^{-259}:\\ \;\;\;\;x \cdot \left(z \cdot 6 - 3\right)\\ \mathbf{elif}\;z \leq -4.5 \cdot 10^{-290}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 136000:\\ \;\;\;\;x \cdot \left(z \cdot 6 - 3\right)\\ \mathbf{else}:\\ \;\;\;\;-6 \cdot \left(z \cdot \left(y - x\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 50.7% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := -6 \cdot \left(z \cdot y\right)\\ \mathbf{if}\;z \leq -1.7 \cdot 10^{+156}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;z \leq -4.6 \cdot 10^{+73}:\\ \;\;\;\;6 \cdot \left(x \cdot z\right)\\ \mathbf{elif}\;z \leq -42000 \lor \neg \left(z \leq 0.58\right):\\ \;\;\;\;t\_0\\ \mathbf{else}:\\ \;\;\;\;x \cdot -3\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (let* ((t_0 (* -6.0 (* z y))))
   (if (<= z -1.7e+156)
     t_0
     (if (<= z -4.6e+73)
       (* 6.0 (* x z))
       (if (or (<= z -42000.0) (not (<= z 0.58))) t_0 (* x -3.0))))))
double code(double x, double y, double z) {
	double t_0 = -6.0 * (z * y);
	double tmp;
	if (z <= -1.7e+156) {
		tmp = t_0;
	} else if (z <= -4.6e+73) {
		tmp = 6.0 * (x * z);
	} else if ((z <= -42000.0) || !(z <= 0.58)) {
		tmp = t_0;
	} else {
		tmp = x * -3.0;
	}
	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) :: tmp
    t_0 = (-6.0d0) * (z * y)
    if (z <= (-1.7d+156)) then
        tmp = t_0
    else if (z <= (-4.6d+73)) then
        tmp = 6.0d0 * (x * z)
    else if ((z <= (-42000.0d0)) .or. (.not. (z <= 0.58d0))) then
        tmp = t_0
    else
        tmp = x * (-3.0d0)
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double t_0 = -6.0 * (z * y);
	double tmp;
	if (z <= -1.7e+156) {
		tmp = t_0;
	} else if (z <= -4.6e+73) {
		tmp = 6.0 * (x * z);
	} else if ((z <= -42000.0) || !(z <= 0.58)) {
		tmp = t_0;
	} else {
		tmp = x * -3.0;
	}
	return tmp;
}
def code(x, y, z):
	t_0 = -6.0 * (z * y)
	tmp = 0
	if z <= -1.7e+156:
		tmp = t_0
	elif z <= -4.6e+73:
		tmp = 6.0 * (x * z)
	elif (z <= -42000.0) or not (z <= 0.58):
		tmp = t_0
	else:
		tmp = x * -3.0
	return tmp
function code(x, y, z)
	t_0 = Float64(-6.0 * Float64(z * y))
	tmp = 0.0
	if (z <= -1.7e+156)
		tmp = t_0;
	elseif (z <= -4.6e+73)
		tmp = Float64(6.0 * Float64(x * z));
	elseif ((z <= -42000.0) || !(z <= 0.58))
		tmp = t_0;
	else
		tmp = Float64(x * -3.0);
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	t_0 = -6.0 * (z * y);
	tmp = 0.0;
	if (z <= -1.7e+156)
		tmp = t_0;
	elseif (z <= -4.6e+73)
		tmp = 6.0 * (x * z);
	elseif ((z <= -42000.0) || ~((z <= 0.58)))
		tmp = t_0;
	else
		tmp = x * -3.0;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := Block[{t$95$0 = N[(-6.0 * N[(z * y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.7e+156], t$95$0, If[LessEqual[z, -4.6e+73], N[(6.0 * N[(x * z), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[z, -42000.0], N[Not[LessEqual[z, 0.58]], $MachinePrecision]], t$95$0, N[(x * -3.0), $MachinePrecision]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := -6 \cdot \left(z \cdot y\right)\\
\mathbf{if}\;z \leq -1.7 \cdot 10^{+156}:\\
\;\;\;\;t\_0\\

\mathbf{elif}\;z \leq -4.6 \cdot 10^{+73}:\\
\;\;\;\;6 \cdot \left(x \cdot z\right)\\

\mathbf{elif}\;z \leq -42000 \lor \neg \left(z \leq 0.58\right):\\
\;\;\;\;t\_0\\

\mathbf{else}:\\
\;\;\;\;x \cdot -3\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -1.7e156 or -4.6e73 < z < -42000 or 0.57999999999999996 < z

    1. Initial program 99.8%

      \[x + \left(\left(y - x\right) \cdot 6\right) \cdot \left(\frac{2}{3} - z\right) \]
    2. Step-by-step derivation
      1. metadata-eval99.8%

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

      \[\leadsto \color{blue}{x + \left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in z around 0 99.8%

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

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

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

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

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

    if -1.7e156 < z < -4.6e73

    1. Initial program 99.9%

      \[x + \left(\left(y - x\right) \cdot 6\right) \cdot \left(\frac{2}{3} - z\right) \]
    2. Step-by-step derivation
      1. metadata-eval99.9%

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

      \[\leadsto \color{blue}{x + \left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in z around 0 99.8%

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

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

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

    if -42000 < z < 0.57999999999999996

    1. Initial program 99.4%

      \[x + \left(\left(y - x\right) \cdot 6\right) \cdot \left(\frac{2}{3} - z\right) \]
    2. Step-by-step derivation
      1. metadata-eval99.4%

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

      \[\leadsto \color{blue}{x + \left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in z around 0 97.1%

      \[\leadsto x + \color{blue}{4 \cdot \left(y - x\right)} \]
    6. Taylor expanded in x around inf 53.6%

      \[\leadsto \color{blue}{-3 \cdot x} \]
    7. Step-by-step derivation
      1. *-commutative53.6%

        \[\leadsto \color{blue}{x \cdot -3} \]
    8. Simplified53.6%

      \[\leadsto \color{blue}{x \cdot -3} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification57.9%

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.7 \cdot 10^{+156}:\\ \;\;\;\;-6 \cdot \left(z \cdot y\right)\\ \mathbf{elif}\;z \leq -4.6 \cdot 10^{+73}:\\ \;\;\;\;6 \cdot \left(x \cdot z\right)\\ \mathbf{elif}\;z \leq -42000 \lor \neg \left(z \leq 0.58\right):\\ \;\;\;\;-6 \cdot \left(z \cdot y\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot -3\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 50.7% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := -6 \cdot \left(z \cdot y\right)\\ \mathbf{if}\;z \leq -42000:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;z \leq -3 \cdot 10^{-260}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq -3.3 \cdot 10^{-288}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 0.55:\\ \;\;\;\;x \cdot -3\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (let* ((t_0 (* -6.0 (* z y))))
   (if (<= z -42000.0)
     t_0
     (if (<= z -3e-260)
       (* x -3.0)
       (if (<= z -3.3e-288) (* y 4.0) (if (<= z 0.55) (* x -3.0) t_0))))))
double code(double x, double y, double z) {
	double t_0 = -6.0 * (z * y);
	double tmp;
	if (z <= -42000.0) {
		tmp = t_0;
	} else if (z <= -3e-260) {
		tmp = x * -3.0;
	} else if (z <= -3.3e-288) {
		tmp = y * 4.0;
	} else if (z <= 0.55) {
		tmp = x * -3.0;
	} else {
		tmp = t_0;
	}
	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) :: tmp
    t_0 = (-6.0d0) * (z * y)
    if (z <= (-42000.0d0)) then
        tmp = t_0
    else if (z <= (-3d-260)) then
        tmp = x * (-3.0d0)
    else if (z <= (-3.3d-288)) then
        tmp = y * 4.0d0
    else if (z <= 0.55d0) then
        tmp = x * (-3.0d0)
    else
        tmp = t_0
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double t_0 = -6.0 * (z * y);
	double tmp;
	if (z <= -42000.0) {
		tmp = t_0;
	} else if (z <= -3e-260) {
		tmp = x * -3.0;
	} else if (z <= -3.3e-288) {
		tmp = y * 4.0;
	} else if (z <= 0.55) {
		tmp = x * -3.0;
	} else {
		tmp = t_0;
	}
	return tmp;
}
def code(x, y, z):
	t_0 = -6.0 * (z * y)
	tmp = 0
	if z <= -42000.0:
		tmp = t_0
	elif z <= -3e-260:
		tmp = x * -3.0
	elif z <= -3.3e-288:
		tmp = y * 4.0
	elif z <= 0.55:
		tmp = x * -3.0
	else:
		tmp = t_0
	return tmp
function code(x, y, z)
	t_0 = Float64(-6.0 * Float64(z * y))
	tmp = 0.0
	if (z <= -42000.0)
		tmp = t_0;
	elseif (z <= -3e-260)
		tmp = Float64(x * -3.0);
	elseif (z <= -3.3e-288)
		tmp = Float64(y * 4.0);
	elseif (z <= 0.55)
		tmp = Float64(x * -3.0);
	else
		tmp = t_0;
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	t_0 = -6.0 * (z * y);
	tmp = 0.0;
	if (z <= -42000.0)
		tmp = t_0;
	elseif (z <= -3e-260)
		tmp = x * -3.0;
	elseif (z <= -3.3e-288)
		tmp = y * 4.0;
	elseif (z <= 0.55)
		tmp = x * -3.0;
	else
		tmp = t_0;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := Block[{t$95$0 = N[(-6.0 * N[(z * y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -42000.0], t$95$0, If[LessEqual[z, -3e-260], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, -3.3e-288], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 0.55], N[(x * -3.0), $MachinePrecision], t$95$0]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := -6 \cdot \left(z \cdot y\right)\\
\mathbf{if}\;z \leq -42000:\\
\;\;\;\;t\_0\\

\mathbf{elif}\;z \leq -3 \cdot 10^{-260}:\\
\;\;\;\;x \cdot -3\\

\mathbf{elif}\;z \leq -3.3 \cdot 10^{-288}:\\
\;\;\;\;y \cdot 4\\

\mathbf{elif}\;z \leq 0.55:\\
\;\;\;\;x \cdot -3\\

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


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

    1. Initial program 99.8%

      \[x + \left(\left(y - x\right) \cdot 6\right) \cdot \left(\frac{2}{3} - z\right) \]
    2. Step-by-step derivation
      1. metadata-eval99.8%

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

      \[\leadsto \color{blue}{x + \left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in z around 0 99.8%

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

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

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

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

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

    if -42000 < z < -3.0000000000000001e-260 or -3.29999999999999988e-288 < z < 0.55000000000000004

    1. Initial program 99.4%

      \[x + \left(\left(y - x\right) \cdot 6\right) \cdot \left(\frac{2}{3} - z\right) \]
    2. Step-by-step derivation
      1. metadata-eval99.4%

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

      \[\leadsto \color{blue}{x + \left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in z around 0 96.9%

      \[\leadsto x + \color{blue}{4 \cdot \left(y - x\right)} \]
    6. Taylor expanded in x around inf 56.4%

      \[\leadsto \color{blue}{-3 \cdot x} \]
    7. Step-by-step derivation
      1. *-commutative56.4%

        \[\leadsto \color{blue}{x \cdot -3} \]
    8. Simplified56.4%

      \[\leadsto \color{blue}{x \cdot -3} \]

    if -3.0000000000000001e-260 < z < -3.29999999999999988e-288

    1. Initial program 99.4%

      \[x + \left(\left(y - x\right) \cdot 6\right) \cdot \left(\frac{2}{3} - z\right) \]
    2. Step-by-step derivation
      1. metadata-eval99.4%

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

      \[\leadsto \color{blue}{x + \left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in z around 0 99.9%

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

      \[\leadsto \color{blue}{4 \cdot y} \]
    7. Step-by-step derivation
      1. *-commutative79.2%

        \[\leadsto \color{blue}{y \cdot 4} \]
    8. Simplified79.2%

      \[\leadsto \color{blue}{y \cdot 4} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification57.7%

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -42000:\\ \;\;\;\;-6 \cdot \left(z \cdot y\right)\\ \mathbf{elif}\;z \leq -3 \cdot 10^{-260}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq -3.3 \cdot 10^{-288}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 0.55:\\ \;\;\;\;x \cdot -3\\ \mathbf{else}:\\ \;\;\;\;-6 \cdot \left(z \cdot y\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 74.7% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -1.3 \cdot 10^{-69} \lor \neg \left(y \leq 3 \cdot 10^{-27}\right):\\ \;\;\;\;y \cdot \left(4 + -6 \cdot z\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(z \cdot 6 - 3\right)\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (if (or (<= y -1.3e-69) (not (<= y 3e-27)))
   (* y (+ 4.0 (* -6.0 z)))
   (* x (- (* z 6.0) 3.0))))
double code(double x, double y, double z) {
	double tmp;
	if ((y <= -1.3e-69) || !(y <= 3e-27)) {
		tmp = y * (4.0 + (-6.0 * z));
	} else {
		tmp = x * ((z * 6.0) - 3.0);
	}
	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 ((y <= (-1.3d-69)) .or. (.not. (y <= 3d-27))) then
        tmp = y * (4.0d0 + ((-6.0d0) * z))
    else
        tmp = x * ((z * 6.0d0) - 3.0d0)
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double tmp;
	if ((y <= -1.3e-69) || !(y <= 3e-27)) {
		tmp = y * (4.0 + (-6.0 * z));
	} else {
		tmp = x * ((z * 6.0) - 3.0);
	}
	return tmp;
}
def code(x, y, z):
	tmp = 0
	if (y <= -1.3e-69) or not (y <= 3e-27):
		tmp = y * (4.0 + (-6.0 * z))
	else:
		tmp = x * ((z * 6.0) - 3.0)
	return tmp
function code(x, y, z)
	tmp = 0.0
	if ((y <= -1.3e-69) || !(y <= 3e-27))
		tmp = Float64(y * Float64(4.0 + Float64(-6.0 * z)));
	else
		tmp = Float64(x * Float64(Float64(z * 6.0) - 3.0));
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	tmp = 0.0;
	if ((y <= -1.3e-69) || ~((y <= 3e-27)))
		tmp = y * (4.0 + (-6.0 * z));
	else
		tmp = x * ((z * 6.0) - 3.0);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := If[Or[LessEqual[y, -1.3e-69], N[Not[LessEqual[y, 3e-27]], $MachinePrecision]], N[(y * N[(4.0 + N[(-6.0 * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[(N[(z * 6.0), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.3 \cdot 10^{-69} \lor \neg \left(y \leq 3 \cdot 10^{-27}\right):\\
\;\;\;\;y \cdot \left(4 + -6 \cdot z\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -1.3000000000000001e-69 or 3.0000000000000001e-27 < y

    1. Initial program 99.6%

      \[x + \left(\left(y - x\right) \cdot 6\right) \cdot \left(\frac{2}{3} - z\right) \]
    2. Step-by-step derivation
      1. metadata-eval99.6%

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

      \[\leadsto \color{blue}{x + \left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in z around 0 99.9%

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

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

    if -1.3000000000000001e-69 < y < 3.0000000000000001e-27

    1. Initial program 99.5%

      \[x + \left(\left(y - x\right) \cdot 6\right) \cdot \left(\frac{2}{3} - z\right) \]
    2. Step-by-step derivation
      1. metadata-eval99.5%

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

      \[\leadsto \color{blue}{x + \left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in z around 0 99.7%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.3 \cdot 10^{-69} \lor \neg \left(y \leq 3 \cdot 10^{-27}\right):\\ \;\;\;\;y \cdot \left(4 + -6 \cdot z\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(z \cdot 6 - 3\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 97.8% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -0.6 \lor \neg \left(z \leq 0.54\right):\\ \;\;\;\;-6 \cdot \left(z \cdot \left(y - x\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x + \left(y - x\right) \cdot 4\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (if (or (<= z -0.6) (not (<= z 0.54)))
   (* -6.0 (* z (- y x)))
   (+ x (* (- y x) 4.0))))
double code(double x, double y, double z) {
	double tmp;
	if ((z <= -0.6) || !(z <= 0.54)) {
		tmp = -6.0 * (z * (y - x));
	} else {
		tmp = x + ((y - x) * 4.0);
	}
	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 <= (-0.6d0)) .or. (.not. (z <= 0.54d0))) then
        tmp = (-6.0d0) * (z * (y - x))
    else
        tmp = x + ((y - x) * 4.0d0)
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double tmp;
	if ((z <= -0.6) || !(z <= 0.54)) {
		tmp = -6.0 * (z * (y - x));
	} else {
		tmp = x + ((y - x) * 4.0);
	}
	return tmp;
}
def code(x, y, z):
	tmp = 0
	if (z <= -0.6) or not (z <= 0.54):
		tmp = -6.0 * (z * (y - x))
	else:
		tmp = x + ((y - x) * 4.0)
	return tmp
function code(x, y, z)
	tmp = 0.0
	if ((z <= -0.6) || !(z <= 0.54))
		tmp = Float64(-6.0 * Float64(z * Float64(y - x)));
	else
		tmp = Float64(x + Float64(Float64(y - x) * 4.0));
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	tmp = 0.0;
	if ((z <= -0.6) || ~((z <= 0.54)))
		tmp = -6.0 * (z * (y - x));
	else
		tmp = x + ((y - x) * 4.0);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := If[Or[LessEqual[z, -0.6], N[Not[LessEqual[z, 0.54]], $MachinePrecision]], N[(-6.0 * N[(z * N[(y - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(y - x), $MachinePrecision] * 4.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

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

\mathbf{else}:\\
\;\;\;\;x + \left(y - x\right) \cdot 4\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -0.599999999999999978 or 0.54000000000000004 < z

    1. Initial program 99.8%

      \[x + \left(\left(y - x\right) \cdot 6\right) \cdot \left(\frac{2}{3} - z\right) \]
    2. Step-by-step derivation
      1. metadata-eval99.8%

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

      \[\leadsto \color{blue}{x + \left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in z around 0 99.8%

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

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

    if -0.599999999999999978 < z < 0.54000000000000004

    1. Initial program 99.4%

      \[x + \left(\left(y - x\right) \cdot 6\right) \cdot \left(\frac{2}{3} - z\right) \]
    2. Step-by-step derivation
      1. metadata-eval99.4%

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

      \[\leadsto \color{blue}{x + \left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in z around 0 98.9%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -0.6 \lor \neg \left(z \leq 0.54\right):\\ \;\;\;\;-6 \cdot \left(z \cdot \left(y - x\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x + \left(y - x\right) \cdot 4\\ \end{array} \]
  5. Add Preprocessing

Alternative 8: 97.8% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -0.54 \lor \neg \left(z \leq 0.65\right):\\ \;\;\;\;-6 \cdot \left(z \cdot \left(y - x\right)\right)\\ \mathbf{else}:\\ \;\;\;\;y \cdot 4 + x \cdot -3\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (if (or (<= z -0.54) (not (<= z 0.65)))
   (* -6.0 (* z (- y x)))
   (+ (* y 4.0) (* x -3.0))))
double code(double x, double y, double z) {
	double tmp;
	if ((z <= -0.54) || !(z <= 0.65)) {
		tmp = -6.0 * (z * (y - x));
	} else {
		tmp = (y * 4.0) + (x * -3.0);
	}
	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 <= (-0.54d0)) .or. (.not. (z <= 0.65d0))) then
        tmp = (-6.0d0) * (z * (y - x))
    else
        tmp = (y * 4.0d0) + (x * (-3.0d0))
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double tmp;
	if ((z <= -0.54) || !(z <= 0.65)) {
		tmp = -6.0 * (z * (y - x));
	} else {
		tmp = (y * 4.0) + (x * -3.0);
	}
	return tmp;
}
def code(x, y, z):
	tmp = 0
	if (z <= -0.54) or not (z <= 0.65):
		tmp = -6.0 * (z * (y - x))
	else:
		tmp = (y * 4.0) + (x * -3.0)
	return tmp
function code(x, y, z)
	tmp = 0.0
	if ((z <= -0.54) || !(z <= 0.65))
		tmp = Float64(-6.0 * Float64(z * Float64(y - x)));
	else
		tmp = Float64(Float64(y * 4.0) + Float64(x * -3.0));
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	tmp = 0.0;
	if ((z <= -0.54) || ~((z <= 0.65)))
		tmp = -6.0 * (z * (y - x));
	else
		tmp = (y * 4.0) + (x * -3.0);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := If[Or[LessEqual[z, -0.54], N[Not[LessEqual[z, 0.65]], $MachinePrecision]], N[(-6.0 * N[(z * N[(y - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y * 4.0), $MachinePrecision] + N[(x * -3.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

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

\mathbf{else}:\\
\;\;\;\;y \cdot 4 + x \cdot -3\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -0.54000000000000004 or 0.650000000000000022 < z

    1. Initial program 99.8%

      \[x + \left(\left(y - x\right) \cdot 6\right) \cdot \left(\frac{2}{3} - z\right) \]
    2. Step-by-step derivation
      1. metadata-eval99.8%

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

      \[\leadsto \color{blue}{x + \left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in z around 0 99.8%

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

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

    if -0.54000000000000004 < z < 0.650000000000000022

    1. Initial program 99.4%

      \[x + \left(\left(y - x\right) \cdot 6\right) \cdot \left(\frac{2}{3} - z\right) \]
    2. Step-by-step derivation
      1. metadata-eval99.4%

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

      \[\leadsto \color{blue}{x + \left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in z around 0 98.9%

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

      \[\leadsto \color{blue}{-3 \cdot x + 4 \cdot y} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification98.0%

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -0.54 \lor \neg \left(z \leq 0.65\right):\\ \;\;\;\;-6 \cdot \left(z \cdot \left(y - x\right)\right)\\ \mathbf{else}:\\ \;\;\;\;y \cdot 4 + x \cdot -3\\ \end{array} \]
  5. Add Preprocessing

Alternative 9: 37.5% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -1.95 \cdot 10^{-76} \lor \neg \left(y \leq 2.7 \cdot 10^{-38}\right):\\ \;\;\;\;y \cdot 4\\ \mathbf{else}:\\ \;\;\;\;x \cdot -3\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (if (or (<= y -1.95e-76) (not (<= y 2.7e-38))) (* y 4.0) (* x -3.0)))
double code(double x, double y, double z) {
	double tmp;
	if ((y <= -1.95e-76) || !(y <= 2.7e-38)) {
		tmp = y * 4.0;
	} else {
		tmp = x * -3.0;
	}
	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 ((y <= (-1.95d-76)) .or. (.not. (y <= 2.7d-38))) then
        tmp = y * 4.0d0
    else
        tmp = x * (-3.0d0)
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double tmp;
	if ((y <= -1.95e-76) || !(y <= 2.7e-38)) {
		tmp = y * 4.0;
	} else {
		tmp = x * -3.0;
	}
	return tmp;
}
def code(x, y, z):
	tmp = 0
	if (y <= -1.95e-76) or not (y <= 2.7e-38):
		tmp = y * 4.0
	else:
		tmp = x * -3.0
	return tmp
function code(x, y, z)
	tmp = 0.0
	if ((y <= -1.95e-76) || !(y <= 2.7e-38))
		tmp = Float64(y * 4.0);
	else
		tmp = Float64(x * -3.0);
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	tmp = 0.0;
	if ((y <= -1.95e-76) || ~((y <= 2.7e-38)))
		tmp = y * 4.0;
	else
		tmp = x * -3.0;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := If[Or[LessEqual[y, -1.95e-76], N[Not[LessEqual[y, 2.7e-38]], $MachinePrecision]], N[(y * 4.0), $MachinePrecision], N[(x * -3.0), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.95 \cdot 10^{-76} \lor \neg \left(y \leq 2.7 \cdot 10^{-38}\right):\\
\;\;\;\;y \cdot 4\\

\mathbf{else}:\\
\;\;\;\;x \cdot -3\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -1.95000000000000013e-76 or 2.70000000000000005e-38 < y

    1. Initial program 99.6%

      \[x + \left(\left(y - x\right) \cdot 6\right) \cdot \left(\frac{2}{3} - z\right) \]
    2. Step-by-step derivation
      1. metadata-eval99.6%

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

      \[\leadsto \color{blue}{x + \left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in z around 0 49.9%

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

      \[\leadsto \color{blue}{4 \cdot y} \]
    7. Step-by-step derivation
      1. *-commutative39.8%

        \[\leadsto \color{blue}{y \cdot 4} \]
    8. Simplified39.8%

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

    if -1.95000000000000013e-76 < y < 2.70000000000000005e-38

    1. Initial program 99.5%

      \[x + \left(\left(y - x\right) \cdot 6\right) \cdot \left(\frac{2}{3} - z\right) \]
    2. Step-by-step derivation
      1. metadata-eval99.5%

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

      \[\leadsto \color{blue}{x + \left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in z around 0 60.0%

      \[\leadsto x + \color{blue}{4 \cdot \left(y - x\right)} \]
    6. Taylor expanded in x around inf 51.0%

      \[\leadsto \color{blue}{-3 \cdot x} \]
    7. Step-by-step derivation
      1. *-commutative51.0%

        \[\leadsto \color{blue}{x \cdot -3} \]
    8. Simplified51.0%

      \[\leadsto \color{blue}{x \cdot -3} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification45.0%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.95 \cdot 10^{-76} \lor \neg \left(y \leq 2.7 \cdot 10^{-38}\right):\\ \;\;\;\;y \cdot 4\\ \mathbf{else}:\\ \;\;\;\;x \cdot -3\\ \end{array} \]
  5. Add Preprocessing

Alternative 10: 99.5% accurate, 1.2× speedup?

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

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

    \[x + \left(\left(y - x\right) \cdot 6\right) \cdot \left(\frac{2}{3} - z\right) \]
  2. Step-by-step derivation
    1. metadata-eval99.6%

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

    \[\leadsto \color{blue}{x + \left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right)} \]
  4. Add Preprocessing
  5. Final simplification99.6%

    \[\leadsto x + \left(0.6666666666666666 - z\right) \cdot \left(\left(y - x\right) \cdot 6\right) \]
  6. Add Preprocessing

Alternative 11: 99.8% accurate, 1.2× speedup?

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

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

    \[x + \left(\left(y - x\right) \cdot 6\right) \cdot \left(\frac{2}{3} - z\right) \]
  2. Step-by-step derivation
    1. +-commutative99.6%

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(y - x, 6 \cdot \left(\frac{2}{3} - z\right), x\right)} \]
    4. metadata-eval99.7%

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

    \[\leadsto \color{blue}{\mathsf{fma}\left(y - x, 6 \cdot \left(0.6666666666666666 - z\right), x\right)} \]
  4. Add Preprocessing
  5. Step-by-step derivation
    1. fma-undefine99.7%

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

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

    \[\leadsto x + \left(y - x\right) \cdot \left(6 \cdot \left(0.6666666666666666 - z\right)\right) \]
  8. Add Preprocessing

Alternative 12: 26.1% accurate, 4.3× speedup?

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

\\
x \cdot -3
\end{array}
Derivation
  1. Initial program 99.6%

    \[x + \left(\left(y - x\right) \cdot 6\right) \cdot \left(\frac{2}{3} - z\right) \]
  2. Step-by-step derivation
    1. metadata-eval99.6%

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

    \[\leadsto \color{blue}{x + \left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right)} \]
  4. Add Preprocessing
  5. Taylor expanded in z around 0 54.6%

    \[\leadsto x + \color{blue}{4 \cdot \left(y - x\right)} \]
  6. Taylor expanded in x around inf 30.6%

    \[\leadsto \color{blue}{-3 \cdot x} \]
  7. Step-by-step derivation
    1. *-commutative30.6%

      \[\leadsto \color{blue}{x \cdot -3} \]
  8. Simplified30.6%

    \[\leadsto \color{blue}{x \cdot -3} \]
  9. Final simplification30.6%

    \[\leadsto x \cdot -3 \]
  10. Add Preprocessing

Reproduce

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