Data.Colour.RGBSpace.HSV:hsv from colour-2.3.3, I

Percentage Accurate: 96.0% → 97.9%
Time: 5.8s
Alternatives: 5
Speedup: 0.5×

Specification

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

\\
x \cdot \left(1 - y \cdot 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 5 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: 96.0% accurate, 1.0× speedup?

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

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

Alternative 1: 97.9% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := x \cdot \left(1 - y \cdot z\right)\\ \mathbf{if}\;t_0 \leq -\infty:\\ \;\;\;\;\left(-y\right) \cdot \left(x \cdot z\right)\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (let* ((t_0 (* x (- 1.0 (* y z)))))
   (if (<= t_0 (- INFINITY)) (* (- y) (* x z)) t_0)))
double code(double x, double y, double z) {
	double t_0 = x * (1.0 - (y * z));
	double tmp;
	if (t_0 <= -((double) INFINITY)) {
		tmp = -y * (x * z);
	} else {
		tmp = t_0;
	}
	return tmp;
}
public static double code(double x, double y, double z) {
	double t_0 = x * (1.0 - (y * z));
	double tmp;
	if (t_0 <= -Double.POSITIVE_INFINITY) {
		tmp = -y * (x * z);
	} else {
		tmp = t_0;
	}
	return tmp;
}
def code(x, y, z):
	t_0 = x * (1.0 - (y * z))
	tmp = 0
	if t_0 <= -math.inf:
		tmp = -y * (x * z)
	else:
		tmp = t_0
	return tmp
function code(x, y, z)
	t_0 = Float64(x * Float64(1.0 - Float64(y * z)))
	tmp = 0.0
	if (t_0 <= Float64(-Inf))
		tmp = Float64(Float64(-y) * Float64(x * z));
	else
		tmp = t_0;
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	t_0 = x * (1.0 - (y * z));
	tmp = 0.0;
	if (t_0 <= -Inf)
		tmp = -y * (x * z);
	else
		tmp = t_0;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := Block[{t$95$0 = N[(x * N[(1.0 - N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, (-Infinity)], N[((-y) * N[(x * z), $MachinePrecision]), $MachinePrecision], t$95$0]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := x \cdot \left(1 - y \cdot z\right)\\
\mathbf{if}\;t_0 \leq -\infty:\\
\;\;\;\;\left(-y\right) \cdot \left(x \cdot z\right)\\

\mathbf{else}:\\
\;\;\;\;t_0\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 x (-.f64 1 (*.f64 y z))) < -inf.0

    1. Initial program 76.9%

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

      \[\leadsto \color{blue}{-1 \cdot \left(x \cdot \left(y \cdot z\right)\right)} \]
    3. Step-by-step derivation
      1. mul-1-neg76.9%

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

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

        \[\leadsto -\color{blue}{\left(x \cdot z\right) \cdot y} \]
      4. distribute-rgt-neg-out99.9%

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

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

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

    if -inf.0 < (*.f64 x (-.f64 1 (*.f64 y z)))

    1. Initial program 98.6%

      \[x \cdot \left(1 - y \cdot z\right) \]
  3. Recombined 2 regimes into one program.
  4. Final simplification98.8%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \cdot \left(1 - y \cdot z\right) \leq -\infty:\\ \;\;\;\;\left(-y\right) \cdot \left(x \cdot z\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(1 - y \cdot z\right)\\ \end{array} \]

Alternative 2: 69.4% accurate, 0.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.4 \cdot 10^{-59} \lor \neg \left(z \leq 2.7 \cdot 10^{+70}\right):\\
\;\;\;\;x \cdot \left(y \cdot \left(-z\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -1.3999999999999999e-59 or 2.7e70 < z

    1. Initial program 93.1%

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

      \[\leadsto \color{blue}{-1 \cdot \left(x \cdot \left(y \cdot z\right)\right)} \]
    3. Step-by-step derivation
      1. mul-1-neg66.9%

        \[\leadsto \color{blue}{-x \cdot \left(y \cdot z\right)} \]
      2. distribute-rgt-neg-out66.9%

        \[\leadsto \color{blue}{x \cdot \left(-y \cdot z\right)} \]
      3. distribute-rgt-neg-in66.9%

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

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

    if -1.3999999999999999e-59 < z < 2.7e70

    1. Initial program 99.9%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.4 \cdot 10^{-59} \lor \neg \left(z \leq 2.7 \cdot 10^{+70}\right):\\ \;\;\;\;x \cdot \left(y \cdot \left(-z\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]

Alternative 3: 70.4% accurate, 0.7× speedup?

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

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

\mathbf{elif}\;z \leq 2.9 \cdot 10^{+72}:\\
\;\;\;\;x\\

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


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

    1. Initial program 92.5%

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

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

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

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

        \[\leadsto -\color{blue}{\left(x \cdot z\right) \cdot y} \]
      4. distribute-rgt-neg-out67.8%

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

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

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

    if -1.28e-49 < z < 2.90000000000000017e72

    1. Initial program 99.9%

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

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

    if 2.90000000000000017e72 < z

    1. Initial program 94.1%

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

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

        \[\leadsto \color{blue}{-x \cdot \left(y \cdot z\right)} \]
      2. distribute-rgt-neg-out75.4%

        \[\leadsto \color{blue}{x \cdot \left(-y \cdot z\right)} \]
      3. distribute-rgt-neg-in75.4%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.28 \cdot 10^{-49}:\\ \;\;\;\;\left(-y\right) \cdot \left(x \cdot z\right)\\ \mathbf{elif}\;z \leq 2.9 \cdot 10^{+72}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(y \cdot \left(-z\right)\right)\\ \end{array} \]

Alternative 4: 70.3% accurate, 0.7× speedup?

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

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

\mathbf{elif}\;z \leq 3.5 \cdot 10^{+67}:\\
\;\;\;\;x\\

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


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

    1. Initial program 92.5%

      \[x \cdot \left(1 - y \cdot z\right) \]
    2. Step-by-step derivation
      1. flip--54.0%

        \[\leadsto x \cdot \color{blue}{\frac{1 \cdot 1 - \left(y \cdot z\right) \cdot \left(y \cdot z\right)}{1 + y \cdot z}} \]
      2. clear-num53.9%

        \[\leadsto x \cdot \color{blue}{\frac{1}{\frac{1 + y \cdot z}{1 \cdot 1 - \left(y \cdot z\right) \cdot \left(y \cdot z\right)}}} \]
      3. un-div-inv54.0%

        \[\leadsto \color{blue}{\frac{x}{\frac{1 + y \cdot z}{1 \cdot 1 - \left(y \cdot z\right) \cdot \left(y \cdot z\right)}}} \]
      4. clear-num53.9%

        \[\leadsto \frac{x}{\color{blue}{\frac{1}{\frac{1 \cdot 1 - \left(y \cdot z\right) \cdot \left(y \cdot z\right)}{1 + y \cdot z}}}} \]
      5. flip--92.4%

        \[\leadsto \frac{x}{\frac{1}{\color{blue}{1 - y \cdot z}}} \]
    3. Applied egg-rr92.4%

      \[\leadsto \color{blue}{\frac{x}{\frac{1}{1 - y \cdot z}}} \]
    4. Taylor expanded in y around inf 61.6%

      \[\leadsto \frac{x}{\color{blue}{\frac{-1}{y \cdot z}}} \]
    5. Step-by-step derivation
      1. div-inv61.6%

        \[\leadsto \color{blue}{x \cdot \frac{1}{\frac{-1}{y \cdot z}}} \]
      2. frac-2neg61.6%

        \[\leadsto x \cdot \frac{1}{\color{blue}{\frac{--1}{-y \cdot z}}} \]
      3. metadata-eval61.6%

        \[\leadsto x \cdot \frac{1}{\frac{\color{blue}{1}}{-y \cdot z}} \]
      4. remove-double-div61.6%

        \[\leadsto x \cdot \color{blue}{\left(-y \cdot z\right)} \]
      5. distribute-lft-neg-in61.6%

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

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

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

    if -3.00000000000000008e-58 < z < 3.5e67

    1. Initial program 99.9%

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

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

    if 3.5e67 < z

    1. Initial program 94.2%

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

      \[\leadsto \color{blue}{-1 \cdot \left(x \cdot \left(y \cdot z\right)\right)} \]
    3. Step-by-step derivation
      1. mul-1-neg75.9%

        \[\leadsto \color{blue}{-x \cdot \left(y \cdot z\right)} \]
      2. distribute-rgt-neg-out75.9%

        \[\leadsto \color{blue}{x \cdot \left(-y \cdot z\right)} \]
      3. distribute-rgt-neg-in75.9%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -3 \cdot 10^{-58}:\\ \;\;\;\;z \cdot \left(-x \cdot y\right)\\ \mathbf{elif}\;z \leq 3.5 \cdot 10^{+67}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(y \cdot \left(-z\right)\right)\\ \end{array} \]

Alternative 5: 49.6% accurate, 7.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 96.6%

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

    \[\leadsto \color{blue}{x} \]
  3. Final simplification50.7%

    \[\leadsto x \]

Reproduce

?
herbie shell --seed 2023297 
(FPCore (x y z)
  :name "Data.Colour.RGBSpace.HSV:hsv from colour-2.3.3, I"
  :precision binary64
  (* x (- 1.0 (* y z))))