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

Percentage Accurate: 99.7% → 99.7%
Time: 7.2s
Alternatives: 11
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 11 alternatives:

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

Initial Program: 99.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 + \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}
Derivation
  1. Initial program 99.8%

    \[x + \left(\left(y - x\right) \cdot 6\right) \cdot z \]
  2. Add Preprocessing
  3. Final simplification99.8%

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

Alternative 2: 60.7% accurate, 0.3× 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 -1.22 \cdot 10^{+30}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;z \leq -2.9 \cdot 10^{-87}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq 2.15 \cdot 10^{-34}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 9600 \lor \neg \left(z \leq 7.5 \cdot 10^{+82}\right):\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \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 -1.22e+30)
     t_0
     (if (<= z -2.9e-87)
       t_1
       (if (<= z 2.15e-34)
         x
         (if (or (<= z 9600.0) (not (<= z 7.5e+82))) t_1 t_0))))))
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 <= -1.22e+30) {
		tmp = t_0;
	} else if (z <= -2.9e-87) {
		tmp = t_1;
	} else if (z <= 2.15e-34) {
		tmp = x;
	} else if ((z <= 9600.0) || !(z <= 7.5e+82)) {
		tmp = t_1;
	} 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) :: t_1
    real(8) :: tmp
    t_0 = (-6.0d0) * (x * z)
    t_1 = 6.0d0 * (y * z)
    if (z <= (-1.22d+30)) then
        tmp = t_0
    else if (z <= (-2.9d-87)) then
        tmp = t_1
    else if (z <= 2.15d-34) then
        tmp = x
    else if ((z <= 9600.0d0) .or. (.not. (z <= 7.5d+82))) then
        tmp = t_1
    else
        tmp = t_0
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double t_0 = -6.0 * (x * z);
	double t_1 = 6.0 * (y * z);
	double tmp;
	if (z <= -1.22e+30) {
		tmp = t_0;
	} else if (z <= -2.9e-87) {
		tmp = t_1;
	} else if (z <= 2.15e-34) {
		tmp = x;
	} else if ((z <= 9600.0) || !(z <= 7.5e+82)) {
		tmp = t_1;
	} else {
		tmp = t_0;
	}
	return tmp;
}
def code(x, y, z):
	t_0 = -6.0 * (x * z)
	t_1 = 6.0 * (y * z)
	tmp = 0
	if z <= -1.22e+30:
		tmp = t_0
	elif z <= -2.9e-87:
		tmp = t_1
	elif z <= 2.15e-34:
		tmp = x
	elif (z <= 9600.0) or not (z <= 7.5e+82):
		tmp = t_1
	else:
		tmp = t_0
	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 <= -1.22e+30)
		tmp = t_0;
	elseif (z <= -2.9e-87)
		tmp = t_1;
	elseif (z <= 2.15e-34)
		tmp = x;
	elseif ((z <= 9600.0) || !(z <= 7.5e+82))
		tmp = t_1;
	else
		tmp = t_0;
	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 <= -1.22e+30)
		tmp = t_0;
	elseif (z <= -2.9e-87)
		tmp = t_1;
	elseif (z <= 2.15e-34)
		tmp = x;
	elseif ((z <= 9600.0) || ~((z <= 7.5e+82)))
		tmp = t_1;
	else
		tmp = t_0;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := Block[{t$95$0 = N[(-6.0 * N[(x * z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(6.0 * N[(y * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.22e+30], t$95$0, If[LessEqual[z, -2.9e-87], t$95$1, If[LessEqual[z, 2.15e-34], x, If[Or[LessEqual[z, 9600.0], N[Not[LessEqual[z, 7.5e+82]], $MachinePrecision]], t$95$1, t$95$0]]]]]]
\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 -1.22 \cdot 10^{+30}:\\
\;\;\;\;t_0\\

\mathbf{elif}\;z \leq -2.9 \cdot 10^{-87}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;z \leq 2.15 \cdot 10^{-34}:\\
\;\;\;\;x\\

\mathbf{elif}\;z \leq 9600 \lor \neg \left(z \leq 7.5 \cdot 10^{+82}\right):\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -1.22e30 or 9600 < z < 7.4999999999999999e82

    1. Initial program 99.7%

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

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

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

    if -1.22e30 < z < -2.8999999999999999e-87 or 2.15e-34 < z < 9600 or 7.4999999999999999e82 < z

    1. Initial program 99.7%

      \[x + \left(\left(y - x\right) \cdot 6\right) \cdot z \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. 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.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)} \]
    4. Applied egg-rr99.8%

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

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

    if -2.8999999999999999e-87 < z < 2.15e-34

    1. Initial program 99.9%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.22 \cdot 10^{+30}:\\ \;\;\;\;-6 \cdot \left(x \cdot z\right)\\ \mathbf{elif}\;z \leq -2.9 \cdot 10^{-87}:\\ \;\;\;\;6 \cdot \left(y \cdot z\right)\\ \mathbf{elif}\;z \leq 2.15 \cdot 10^{-34}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 9600 \lor \neg \left(z \leq 7.5 \cdot 10^{+82}\right):\\ \;\;\;\;6 \cdot \left(y \cdot z\right)\\ \mathbf{else}:\\ \;\;\;\;-6 \cdot \left(x \cdot z\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 60.7% accurate, 0.3× 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 -1.12 \cdot 10^{+30}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;z \leq -2.6 \cdot 10^{-87}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq 8.4 \cdot 10^{-36}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 9600:\\ \;\;\;\;y \cdot \left(6 \cdot z\right)\\ \mathbf{elif}\;z \leq 1.9 \cdot 10^{+82}:\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \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 -1.12e+30)
     t_0
     (if (<= z -2.6e-87)
       t_1
       (if (<= z 8.4e-36)
         x
         (if (<= z 9600.0) (* y (* 6.0 z)) (if (<= z 1.9e+82) t_0 t_1)))))))
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 <= -1.12e+30) {
		tmp = t_0;
	} else if (z <= -2.6e-87) {
		tmp = t_1;
	} else if (z <= 8.4e-36) {
		tmp = x;
	} else if (z <= 9600.0) {
		tmp = y * (6.0 * z);
	} else if (z <= 1.9e+82) {
		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 = (-6.0d0) * (x * z)
    t_1 = 6.0d0 * (y * z)
    if (z <= (-1.12d+30)) then
        tmp = t_0
    else if (z <= (-2.6d-87)) then
        tmp = t_1
    else if (z <= 8.4d-36) then
        tmp = x
    else if (z <= 9600.0d0) then
        tmp = y * (6.0d0 * z)
    else if (z <= 1.9d+82) 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 = -6.0 * (x * z);
	double t_1 = 6.0 * (y * z);
	double tmp;
	if (z <= -1.12e+30) {
		tmp = t_0;
	} else if (z <= -2.6e-87) {
		tmp = t_1;
	} else if (z <= 8.4e-36) {
		tmp = x;
	} else if (z <= 9600.0) {
		tmp = y * (6.0 * z);
	} else if (z <= 1.9e+82) {
		tmp = t_0;
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z):
	t_0 = -6.0 * (x * z)
	t_1 = 6.0 * (y * z)
	tmp = 0
	if z <= -1.12e+30:
		tmp = t_0
	elif z <= -2.6e-87:
		tmp = t_1
	elif z <= 8.4e-36:
		tmp = x
	elif z <= 9600.0:
		tmp = y * (6.0 * z)
	elif z <= 1.9e+82:
		tmp = t_0
	else:
		tmp = t_1
	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 <= -1.12e+30)
		tmp = t_0;
	elseif (z <= -2.6e-87)
		tmp = t_1;
	elseif (z <= 8.4e-36)
		tmp = x;
	elseif (z <= 9600.0)
		tmp = Float64(y * Float64(6.0 * z));
	elseif (z <= 1.9e+82)
		tmp = t_0;
	else
		tmp = t_1;
	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 <= -1.12e+30)
		tmp = t_0;
	elseif (z <= -2.6e-87)
		tmp = t_1;
	elseif (z <= 8.4e-36)
		tmp = x;
	elseif (z <= 9600.0)
		tmp = y * (6.0 * z);
	elseif (z <= 1.9e+82)
		tmp = t_0;
	else
		tmp = t_1;
	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, -1.12e+30], t$95$0, If[LessEqual[z, -2.6e-87], t$95$1, If[LessEqual[z, 8.4e-36], x, If[LessEqual[z, 9600.0], N[(y * N[(6.0 * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.9e+82], t$95$0, t$95$1]]]]]]]
\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 -1.12 \cdot 10^{+30}:\\
\;\;\;\;t_0\\

\mathbf{elif}\;z \leq -2.6 \cdot 10^{-87}:\\
\;\;\;\;t_1\\

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

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

\mathbf{elif}\;z \leq 1.9 \cdot 10^{+82}:\\
\;\;\;\;t_0\\

\mathbf{else}:\\
\;\;\;\;t_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -1.12e30 or 9600 < z < 1.90000000000000017e82

    1. Initial program 99.7%

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

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

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

    if -1.12e30 < z < -2.60000000000000002e-87 or 1.90000000000000017e82 < z

    1. Initial program 99.8%

      \[x + \left(\left(y - x\right) \cdot 6\right) \cdot z \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. 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.9%

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

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

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

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

    if -2.60000000000000002e-87 < z < 8.39999999999999964e-36

    1. Initial program 99.9%

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

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

    if 8.39999999999999964e-36 < z < 9600

    1. Initial program 99.7%

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.12 \cdot 10^{+30}:\\ \;\;\;\;-6 \cdot \left(x \cdot z\right)\\ \mathbf{elif}\;z \leq -2.6 \cdot 10^{-87}:\\ \;\;\;\;6 \cdot \left(y \cdot z\right)\\ \mathbf{elif}\;z \leq 8.4 \cdot 10^{-36}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 9600:\\ \;\;\;\;y \cdot \left(6 \cdot z\right)\\ \mathbf{elif}\;z \leq 1.9 \cdot 10^{+82}:\\ \;\;\;\;-6 \cdot \left(x \cdot z\right)\\ \mathbf{else}:\\ \;\;\;\;6 \cdot \left(y \cdot z\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 60.7% accurate, 0.3× 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 -4.5 \cdot 10^{+30}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;z \leq -5.5 \cdot 10^{-88}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq 1.12 \cdot 10^{-36}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 7800:\\ \;\;\;\;z \cdot \left(y \cdot 6\right)\\ \mathbf{elif}\;z \leq 1.18 \cdot 10^{+83}:\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \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 -4.5e+30)
     t_0
     (if (<= z -5.5e-88)
       t_1
       (if (<= z 1.12e-36)
         x
         (if (<= z 7800.0) (* z (* y 6.0)) (if (<= z 1.18e+83) t_0 t_1)))))))
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 <= -4.5e+30) {
		tmp = t_0;
	} else if (z <= -5.5e-88) {
		tmp = t_1;
	} else if (z <= 1.12e-36) {
		tmp = x;
	} else if (z <= 7800.0) {
		tmp = z * (y * 6.0);
	} else if (z <= 1.18e+83) {
		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 = (-6.0d0) * (x * z)
    t_1 = 6.0d0 * (y * z)
    if (z <= (-4.5d+30)) then
        tmp = t_0
    else if (z <= (-5.5d-88)) then
        tmp = t_1
    else if (z <= 1.12d-36) then
        tmp = x
    else if (z <= 7800.0d0) then
        tmp = z * (y * 6.0d0)
    else if (z <= 1.18d+83) 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 = -6.0 * (x * z);
	double t_1 = 6.0 * (y * z);
	double tmp;
	if (z <= -4.5e+30) {
		tmp = t_0;
	} else if (z <= -5.5e-88) {
		tmp = t_1;
	} else if (z <= 1.12e-36) {
		tmp = x;
	} else if (z <= 7800.0) {
		tmp = z * (y * 6.0);
	} else if (z <= 1.18e+83) {
		tmp = t_0;
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z):
	t_0 = -6.0 * (x * z)
	t_1 = 6.0 * (y * z)
	tmp = 0
	if z <= -4.5e+30:
		tmp = t_0
	elif z <= -5.5e-88:
		tmp = t_1
	elif z <= 1.12e-36:
		tmp = x
	elif z <= 7800.0:
		tmp = z * (y * 6.0)
	elif z <= 1.18e+83:
		tmp = t_0
	else:
		tmp = t_1
	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 <= -4.5e+30)
		tmp = t_0;
	elseif (z <= -5.5e-88)
		tmp = t_1;
	elseif (z <= 1.12e-36)
		tmp = x;
	elseif (z <= 7800.0)
		tmp = Float64(z * Float64(y * 6.0));
	elseif (z <= 1.18e+83)
		tmp = t_0;
	else
		tmp = t_1;
	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 <= -4.5e+30)
		tmp = t_0;
	elseif (z <= -5.5e-88)
		tmp = t_1;
	elseif (z <= 1.12e-36)
		tmp = x;
	elseif (z <= 7800.0)
		tmp = z * (y * 6.0);
	elseif (z <= 1.18e+83)
		tmp = t_0;
	else
		tmp = t_1;
	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, -4.5e+30], t$95$0, If[LessEqual[z, -5.5e-88], t$95$1, If[LessEqual[z, 1.12e-36], x, If[LessEqual[z, 7800.0], N[(z * N[(y * 6.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.18e+83], t$95$0, t$95$1]]]]]]]
\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 -4.5 \cdot 10^{+30}:\\
\;\;\;\;t_0\\

\mathbf{elif}\;z \leq -5.5 \cdot 10^{-88}:\\
\;\;\;\;t_1\\

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

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

\mathbf{elif}\;z \leq 1.18 \cdot 10^{+83}:\\
\;\;\;\;t_0\\

\mathbf{else}:\\
\;\;\;\;t_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -4.49999999999999995e30 or 7800 < z < 1.1799999999999999e83

    1. Initial program 99.7%

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

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

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

    if -4.49999999999999995e30 < z < -5.49999999999999971e-88 or 1.1799999999999999e83 < z

    1. Initial program 99.8%

      \[x + \left(\left(y - x\right) \cdot 6\right) \cdot z \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. 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.9%

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

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

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

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

    if -5.49999999999999971e-88 < z < 1.12e-36

    1. Initial program 99.9%

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

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

    if 1.12e-36 < z < 7800

    1. Initial program 99.7%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto z \cdot \color{blue}{\left(6 \cdot y\right)} \]
    7. Simplified73.1%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -4.5 \cdot 10^{+30}:\\ \;\;\;\;-6 \cdot \left(x \cdot z\right)\\ \mathbf{elif}\;z \leq -5.5 \cdot 10^{-88}:\\ \;\;\;\;6 \cdot \left(y \cdot z\right)\\ \mathbf{elif}\;z \leq 1.12 \cdot 10^{-36}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 7800:\\ \;\;\;\;z \cdot \left(y \cdot 6\right)\\ \mathbf{elif}\;z \leq 1.18 \cdot 10^{+83}:\\ \;\;\;\;-6 \cdot \left(x \cdot z\right)\\ \mathbf{else}:\\ \;\;\;\;6 \cdot \left(y \cdot z\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 60.7% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := 6 \cdot \left(y \cdot z\right)\\ \mathbf{if}\;z \leq -2.55 \cdot 10^{+26}:\\ \;\;\;\;-6 \cdot \left(x \cdot z\right)\\ \mathbf{elif}\;z \leq -2.8 \cdot 10^{-87}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;z \leq 5.7 \cdot 10^{-33}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 3200:\\ \;\;\;\;z \cdot \left(y \cdot 6\right)\\ \mathbf{elif}\;z \leq 1.1 \cdot 10^{+83}:\\ \;\;\;\;z \cdot \left(x \cdot -6\right)\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (let* ((t_0 (* 6.0 (* y z))))
   (if (<= z -2.55e+26)
     (* -6.0 (* x z))
     (if (<= z -2.8e-87)
       t_0
       (if (<= z 5.7e-33)
         x
         (if (<= z 3200.0)
           (* z (* y 6.0))
           (if (<= z 1.1e+83) (* z (* x -6.0)) t_0)))))))
double code(double x, double y, double z) {
	double t_0 = 6.0 * (y * z);
	double tmp;
	if (z <= -2.55e+26) {
		tmp = -6.0 * (x * z);
	} else if (z <= -2.8e-87) {
		tmp = t_0;
	} else if (z <= 5.7e-33) {
		tmp = x;
	} else if (z <= 3200.0) {
		tmp = z * (y * 6.0);
	} else if (z <= 1.1e+83) {
		tmp = z * (x * -6.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 * (y * z)
    if (z <= (-2.55d+26)) then
        tmp = (-6.0d0) * (x * z)
    else if (z <= (-2.8d-87)) then
        tmp = t_0
    else if (z <= 5.7d-33) then
        tmp = x
    else if (z <= 3200.0d0) then
        tmp = z * (y * 6.0d0)
    else if (z <= 1.1d+83) then
        tmp = z * (x * (-6.0d0))
    else
        tmp = t_0
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double t_0 = 6.0 * (y * z);
	double tmp;
	if (z <= -2.55e+26) {
		tmp = -6.0 * (x * z);
	} else if (z <= -2.8e-87) {
		tmp = t_0;
	} else if (z <= 5.7e-33) {
		tmp = x;
	} else if (z <= 3200.0) {
		tmp = z * (y * 6.0);
	} else if (z <= 1.1e+83) {
		tmp = z * (x * -6.0);
	} else {
		tmp = t_0;
	}
	return tmp;
}
def code(x, y, z):
	t_0 = 6.0 * (y * z)
	tmp = 0
	if z <= -2.55e+26:
		tmp = -6.0 * (x * z)
	elif z <= -2.8e-87:
		tmp = t_0
	elif z <= 5.7e-33:
		tmp = x
	elif z <= 3200.0:
		tmp = z * (y * 6.0)
	elif z <= 1.1e+83:
		tmp = z * (x * -6.0)
	else:
		tmp = t_0
	return tmp
function code(x, y, z)
	t_0 = Float64(6.0 * Float64(y * z))
	tmp = 0.0
	if (z <= -2.55e+26)
		tmp = Float64(-6.0 * Float64(x * z));
	elseif (z <= -2.8e-87)
		tmp = t_0;
	elseif (z <= 5.7e-33)
		tmp = x;
	elseif (z <= 3200.0)
		tmp = Float64(z * Float64(y * 6.0));
	elseif (z <= 1.1e+83)
		tmp = Float64(z * Float64(x * -6.0));
	else
		tmp = t_0;
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	t_0 = 6.0 * (y * z);
	tmp = 0.0;
	if (z <= -2.55e+26)
		tmp = -6.0 * (x * z);
	elseif (z <= -2.8e-87)
		tmp = t_0;
	elseif (z <= 5.7e-33)
		tmp = x;
	elseif (z <= 3200.0)
		tmp = z * (y * 6.0);
	elseif (z <= 1.1e+83)
		tmp = z * (x * -6.0);
	else
		tmp = t_0;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := Block[{t$95$0 = N[(6.0 * N[(y * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2.55e+26], N[(-6.0 * N[(x * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -2.8e-87], t$95$0, If[LessEqual[z, 5.7e-33], x, If[LessEqual[z, 3200.0], N[(z * N[(y * 6.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.1e+83], N[(z * N[(x * -6.0), $MachinePrecision]), $MachinePrecision], t$95$0]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;z \leq -2.8 \cdot 10^{-87}:\\
\;\;\;\;t_0\\

\mathbf{elif}\;z \leq 5.7 \cdot 10^{-33}:\\
\;\;\;\;x\\

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if z < -2.5499999999999999e26

    1. Initial program 99.8%

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

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

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

    if -2.5499999999999999e26 < z < -2.8000000000000001e-87 or 1.09999999999999999e83 < z

    1. Initial program 99.8%

      \[x + \left(\left(y - x\right) \cdot 6\right) \cdot z \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. 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.9%

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

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

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

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

    if -2.8000000000000001e-87 < z < 5.70000000000000025e-33

    1. Initial program 99.9%

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

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

    if 5.70000000000000025e-33 < z < 3200

    1. Initial program 99.7%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto z \cdot \color{blue}{\left(6 \cdot y\right)} \]
    7. Simplified73.1%

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

    if 3200 < z < 1.09999999999999999e83

    1. Initial program 99.6%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -2.55 \cdot 10^{+26}:\\ \;\;\;\;-6 \cdot \left(x \cdot z\right)\\ \mathbf{elif}\;z \leq -2.8 \cdot 10^{-87}:\\ \;\;\;\;6 \cdot \left(y \cdot z\right)\\ \mathbf{elif}\;z \leq 5.7 \cdot 10^{-33}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 3200:\\ \;\;\;\;z \cdot \left(y \cdot 6\right)\\ \mathbf{elif}\;z \leq 1.1 \cdot 10^{+83}:\\ \;\;\;\;z \cdot \left(x \cdot -6\right)\\ \mathbf{else}:\\ \;\;\;\;6 \cdot \left(y \cdot z\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 83.9% accurate, 0.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.56 \cdot 10^{-87} \lor \neg \left(z \leq 1.15 \cdot 10^{-35}\right):\\
\;\;\;\;6 \cdot \left(\left(y - x\right) \cdot z\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -1.55999999999999997e-87 or 1.1499999999999999e-35 < z

    1. Initial program 99.7%

      \[x + \left(\left(y - x\right) \cdot 6\right) \cdot z \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. 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.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)} \]
    4. Applied egg-rr99.8%

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

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

    if -1.55999999999999997e-87 < z < 1.1499999999999999e-35

    1. Initial program 99.9%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.56 \cdot 10^{-87} \lor \neg \left(z \leq 1.15 \cdot 10^{-35}\right):\\ \;\;\;\;6 \cdot \left(\left(y - x\right) \cdot z\right)\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 83.9% accurate, 0.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.6 \cdot 10^{-87} \lor \neg \left(z \leq 5.7 \cdot 10^{-33}\right):\\
\;\;\;\;6 \cdot \left(\left(y - x\right) \cdot z\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -2.60000000000000002e-87 or 5.70000000000000025e-33 < z

    1. Initial program 99.7%

      \[x + \left(\left(y - x\right) \cdot 6\right) \cdot z \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. 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.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)} \]
    4. Applied egg-rr99.8%

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

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

    if -2.60000000000000002e-87 < z < 5.70000000000000025e-33

    1. Initial program 99.9%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -2.6 \cdot 10^{-87} \lor \neg \left(z \leq 5.7 \cdot 10^{-33}\right):\\ \;\;\;\;6 \cdot \left(\left(y - x\right) \cdot z\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(1 + z \cdot -6\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 8: 98.2% accurate, 0.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -0.17 \lor \neg \left(z \leq 2.8 \cdot 10^{-18}\right):\\
\;\;\;\;6 \cdot \left(\left(y - x\right) \cdot z\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -0.170000000000000012 or 2.80000000000000012e-18 < z

    1. Initial program 99.7%

      \[x + \left(\left(y - x\right) \cdot 6\right) \cdot z \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. 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.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)} \]
    4. Applied egg-rr99.8%

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

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

    if -0.170000000000000012 < z < 2.80000000000000012e-18

    1. Initial program 99.9%

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

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

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

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

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

Alternative 9: 98.5% accurate, 0.5× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -0.23000000000000001 or 1.2e-9 < z

    1. Initial program 99.7%

      \[x + \left(\left(y - x\right) \cdot 6\right) \cdot z \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. 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.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)} \]
    4. Applied egg-rr99.8%

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

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

    if -0.23000000000000001 < z < 1.2e-9

    1. Initial program 99.9%

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

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

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

Alternative 10: 60.5% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.7 \cdot 10^{-23} \lor \neg \left(z \leq 2.8 \cdot 10^{-18}\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 < -3.7000000000000003e-23 or 2.80000000000000012e-18 < z

    1. Initial program 99.7%

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

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

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

    if -3.7000000000000003e-23 < z < 2.80000000000000012e-18

    1. Initial program 99.9%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -3.7 \cdot 10^{-23} \lor \neg \left(z \leq 2.8 \cdot 10^{-18}\right):\\ \;\;\;\;-6 \cdot \left(x \cdot z\right)\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]
  5. Add Preprocessing

Alternative 11: 36.6% 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.8%

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

    \[\leadsto \color{blue}{x} \]
  4. Final simplification35.8%

    \[\leadsto x \]
  5. Add Preprocessing

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 2024018 
(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)))