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

Percentage Accurate: 99.7% → 99.8%
Time: 9.5s
Alternatives: 16
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 16 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.8% accurate, 0.1× speedup?

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

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

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

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

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

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

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

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

Alternative 2: 99.8% accurate, 0.1× speedup?

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

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

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

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

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

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

      \[\leadsto \color{blue}{\left(\left(y - x\right) \cdot z\right) \cdot 6} + x \]
    5. fma-define99.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. Final simplification99.8%

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

Alternative 3: 60.9% accurate, 0.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := 6 \cdot \left(y \cdot z\right)\\ t_1 := -6 \cdot \left(x \cdot z\right)\\ \mathbf{if}\;z \leq -3.7 \cdot 10^{+235}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;z \leq -1.55 \cdot 10^{+73}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq -1.1 \cdot 10^{-79}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;z \leq 10^{-23}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 1.95 \cdot 10^{+73} \lor \neg \left(z \leq 1.45 \cdot 10^{+138}\right) \land z \leq 5.5 \cdot 10^{+289}:\\ \;\;\;\;t\_0\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (let* ((t_0 (* 6.0 (* y z))) (t_1 (* -6.0 (* x z))))
   (if (<= z -3.7e+235)
     t_0
     (if (<= z -1.55e+73)
       t_1
       (if (<= z -1.1e-79)
         t_0
         (if (<= z 1e-23)
           x
           (if (or (<= z 1.95e+73)
                   (and (not (<= z 1.45e+138)) (<= z 5.5e+289)))
             t_0
             t_1)))))))
double code(double x, double y, double z) {
	double t_0 = 6.0 * (y * z);
	double t_1 = -6.0 * (x * z);
	double tmp;
	if (z <= -3.7e+235) {
		tmp = t_0;
	} else if (z <= -1.55e+73) {
		tmp = t_1;
	} else if (z <= -1.1e-79) {
		tmp = t_0;
	} else if (z <= 1e-23) {
		tmp = x;
	} else if ((z <= 1.95e+73) || (!(z <= 1.45e+138) && (z <= 5.5e+289))) {
		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 * (y * z)
    t_1 = (-6.0d0) * (x * z)
    if (z <= (-3.7d+235)) then
        tmp = t_0
    else if (z <= (-1.55d+73)) then
        tmp = t_1
    else if (z <= (-1.1d-79)) then
        tmp = t_0
    else if (z <= 1d-23) then
        tmp = x
    else if ((z <= 1.95d+73) .or. (.not. (z <= 1.45d+138)) .and. (z <= 5.5d+289)) 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 * (y * z);
	double t_1 = -6.0 * (x * z);
	double tmp;
	if (z <= -3.7e+235) {
		tmp = t_0;
	} else if (z <= -1.55e+73) {
		tmp = t_1;
	} else if (z <= -1.1e-79) {
		tmp = t_0;
	} else if (z <= 1e-23) {
		tmp = x;
	} else if ((z <= 1.95e+73) || (!(z <= 1.45e+138) && (z <= 5.5e+289))) {
		tmp = t_0;
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z):
	t_0 = 6.0 * (y * z)
	t_1 = -6.0 * (x * z)
	tmp = 0
	if z <= -3.7e+235:
		tmp = t_0
	elif z <= -1.55e+73:
		tmp = t_1
	elif z <= -1.1e-79:
		tmp = t_0
	elif z <= 1e-23:
		tmp = x
	elif (z <= 1.95e+73) or (not (z <= 1.45e+138) and (z <= 5.5e+289)):
		tmp = t_0
	else:
		tmp = t_1
	return tmp
function code(x, y, z)
	t_0 = Float64(6.0 * Float64(y * z))
	t_1 = Float64(-6.0 * Float64(x * z))
	tmp = 0.0
	if (z <= -3.7e+235)
		tmp = t_0;
	elseif (z <= -1.55e+73)
		tmp = t_1;
	elseif (z <= -1.1e-79)
		tmp = t_0;
	elseif (z <= 1e-23)
		tmp = x;
	elseif ((z <= 1.95e+73) || (!(z <= 1.45e+138) && (z <= 5.5e+289)))
		tmp = t_0;
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	t_0 = 6.0 * (y * z);
	t_1 = -6.0 * (x * z);
	tmp = 0.0;
	if (z <= -3.7e+235)
		tmp = t_0;
	elseif (z <= -1.55e+73)
		tmp = t_1;
	elseif (z <= -1.1e-79)
		tmp = t_0;
	elseif (z <= 1e-23)
		tmp = x;
	elseif ((z <= 1.95e+73) || (~((z <= 1.45e+138)) && (z <= 5.5e+289)))
		tmp = t_0;
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := Block[{t$95$0 = N[(6.0 * N[(y * z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(-6.0 * N[(x * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -3.7e+235], t$95$0, If[LessEqual[z, -1.55e+73], t$95$1, If[LessEqual[z, -1.1e-79], t$95$0, If[LessEqual[z, 1e-23], x, If[Or[LessEqual[z, 1.95e+73], And[N[Not[LessEqual[z, 1.45e+138]], $MachinePrecision], LessEqual[z, 5.5e+289]]], t$95$0, t$95$1]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;z \leq -1.55 \cdot 10^{+73}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;z \leq -1.1 \cdot 10^{-79}:\\
\;\;\;\;t\_0\\

\mathbf{elif}\;z \leq 10^{-23}:\\
\;\;\;\;x\\

\mathbf{elif}\;z \leq 1.95 \cdot 10^{+73} \lor \neg \left(z \leq 1.45 \cdot 10^{+138}\right) \land z \leq 5.5 \cdot 10^{+289}:\\
\;\;\;\;t\_0\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -3.6999999999999998e235 or -1.55e73 < z < -1.0999999999999999e-79 or 9.9999999999999996e-24 < z < 1.95e73 or 1.45000000000000005e138 < z < 5.4999999999999999e289

    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.6%

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

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

      \[\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)} \]
    6. Step-by-step derivation
      1. *-commutative64.0%

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

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

    if -3.6999999999999998e235 < z < -1.55e73 or 1.95e73 < z < 1.45000000000000005e138 or 5.4999999999999999e289 < 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.8%

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

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

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

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

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

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

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

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

    if -1.0999999999999999e-79 < z < 9.9999999999999996e-24

    1. Initial program 99.1%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -3.7 \cdot 10^{+235}:\\ \;\;\;\;6 \cdot \left(y \cdot z\right)\\ \mathbf{elif}\;z \leq -1.55 \cdot 10^{+73}:\\ \;\;\;\;-6 \cdot \left(x \cdot z\right)\\ \mathbf{elif}\;z \leq -1.1 \cdot 10^{-79}:\\ \;\;\;\;6 \cdot \left(y \cdot z\right)\\ \mathbf{elif}\;z \leq 10^{-23}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 1.95 \cdot 10^{+73} \lor \neg \left(z \leq 1.45 \cdot 10^{+138}\right) \land z \leq 5.5 \cdot 10^{+289}:\\ \;\;\;\;6 \cdot \left(y \cdot z\right)\\ \mathbf{else}:\\ \;\;\;\;-6 \cdot \left(x \cdot z\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 61.0% accurate, 0.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := 6 \cdot \left(y \cdot z\right)\\ \mathbf{if}\;z \leq -3.4 \cdot 10^{+233}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;z \leq -1.45 \cdot 10^{+66}:\\ \;\;\;\;x \cdot \left(z \cdot -6\right)\\ \mathbf{elif}\;z \leq -9 \cdot 10^{-80}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;z \leq 3.3 \cdot 10^{-25}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 1.45 \cdot 10^{+73} \lor \neg \left(z \leq 3.8 \cdot 10^{+133}\right) \land z \leq 3.7 \cdot 10^{+287}:\\ \;\;\;\;t\_0\\ \mathbf{else}:\\ \;\;\;\;-6 \cdot \left(x \cdot z\right)\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (let* ((t_0 (* 6.0 (* y z))))
   (if (<= z -3.4e+233)
     t_0
     (if (<= z -1.45e+66)
       (* x (* z -6.0))
       (if (<= z -9e-80)
         t_0
         (if (<= z 3.3e-25)
           x
           (if (or (<= z 1.45e+73) (and (not (<= z 3.8e+133)) (<= z 3.7e+287)))
             t_0
             (* -6.0 (* x z)))))))))
double code(double x, double y, double z) {
	double t_0 = 6.0 * (y * z);
	double tmp;
	if (z <= -3.4e+233) {
		tmp = t_0;
	} else if (z <= -1.45e+66) {
		tmp = x * (z * -6.0);
	} else if (z <= -9e-80) {
		tmp = t_0;
	} else if (z <= 3.3e-25) {
		tmp = x;
	} else if ((z <= 1.45e+73) || (!(z <= 3.8e+133) && (z <= 3.7e+287))) {
		tmp = t_0;
	} else {
		tmp = -6.0 * (x * z);
	}
	return tmp;
}
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8) :: t_0
    real(8) :: tmp
    t_0 = 6.0d0 * (y * z)
    if (z <= (-3.4d+233)) then
        tmp = t_0
    else if (z <= (-1.45d+66)) then
        tmp = x * (z * (-6.0d0))
    else if (z <= (-9d-80)) then
        tmp = t_0
    else if (z <= 3.3d-25) then
        tmp = x
    else if ((z <= 1.45d+73) .or. (.not. (z <= 3.8d+133)) .and. (z <= 3.7d+287)) then
        tmp = t_0
    else
        tmp = (-6.0d0) * (x * z)
    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 <= -3.4e+233) {
		tmp = t_0;
	} else if (z <= -1.45e+66) {
		tmp = x * (z * -6.0);
	} else if (z <= -9e-80) {
		tmp = t_0;
	} else if (z <= 3.3e-25) {
		tmp = x;
	} else if ((z <= 1.45e+73) || (!(z <= 3.8e+133) && (z <= 3.7e+287))) {
		tmp = t_0;
	} else {
		tmp = -6.0 * (x * z);
	}
	return tmp;
}
def code(x, y, z):
	t_0 = 6.0 * (y * z)
	tmp = 0
	if z <= -3.4e+233:
		tmp = t_0
	elif z <= -1.45e+66:
		tmp = x * (z * -6.0)
	elif z <= -9e-80:
		tmp = t_0
	elif z <= 3.3e-25:
		tmp = x
	elif (z <= 1.45e+73) or (not (z <= 3.8e+133) and (z <= 3.7e+287)):
		tmp = t_0
	else:
		tmp = -6.0 * (x * z)
	return tmp
function code(x, y, z)
	t_0 = Float64(6.0 * Float64(y * z))
	tmp = 0.0
	if (z <= -3.4e+233)
		tmp = t_0;
	elseif (z <= -1.45e+66)
		tmp = Float64(x * Float64(z * -6.0));
	elseif (z <= -9e-80)
		tmp = t_0;
	elseif (z <= 3.3e-25)
		tmp = x;
	elseif ((z <= 1.45e+73) || (!(z <= 3.8e+133) && (z <= 3.7e+287)))
		tmp = t_0;
	else
		tmp = Float64(-6.0 * Float64(x * z));
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	t_0 = 6.0 * (y * z);
	tmp = 0.0;
	if (z <= -3.4e+233)
		tmp = t_0;
	elseif (z <= -1.45e+66)
		tmp = x * (z * -6.0);
	elseif (z <= -9e-80)
		tmp = t_0;
	elseif (z <= 3.3e-25)
		tmp = x;
	elseif ((z <= 1.45e+73) || (~((z <= 3.8e+133)) && (z <= 3.7e+287)))
		tmp = t_0;
	else
		tmp = -6.0 * (x * z);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := Block[{t$95$0 = N[(6.0 * N[(y * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -3.4e+233], t$95$0, If[LessEqual[z, -1.45e+66], N[(x * N[(z * -6.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -9e-80], t$95$0, If[LessEqual[z, 3.3e-25], x, If[Or[LessEqual[z, 1.45e+73], And[N[Not[LessEqual[z, 3.8e+133]], $MachinePrecision], LessEqual[z, 3.7e+287]]], t$95$0, N[(-6.0 * N[(x * z), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}

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

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

\mathbf{elif}\;z \leq -9 \cdot 10^{-80}:\\
\;\;\;\;t\_0\\

\mathbf{elif}\;z \leq 3.3 \cdot 10^{-25}:\\
\;\;\;\;x\\

\mathbf{elif}\;z \leq 1.45 \cdot 10^{+73} \lor \neg \left(z \leq 3.8 \cdot 10^{+133}\right) \land z \leq 3.7 \cdot 10^{+287}:\\
\;\;\;\;t\_0\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -3.40000000000000022e233 or -1.44999999999999993e66 < z < -9.0000000000000006e-80 or 3.2999999999999998e-25 < z < 1.4500000000000001e73 or 3.8000000000000002e133 < z < 3.69999999999999997e287

    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.7%

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

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

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

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

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

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

    if -3.40000000000000022e233 < z < -1.44999999999999993e66

    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.8%

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

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

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

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

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

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

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

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

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

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

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

    if -9.0000000000000006e-80 < z < 3.2999999999999998e-25

    1. Initial program 99.1%

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

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

    if 1.4500000000000001e73 < z < 3.8000000000000002e133 or 3.69999999999999997e287 < z

    1. Initial program 99.9%

      \[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.7%

        \[\leadsto \color{blue}{\left(\left(y - x\right) \cdot z\right) \cdot 6} + x \]
      5. fma-define99.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 99.7%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -3.4 \cdot 10^{+233}:\\ \;\;\;\;6 \cdot \left(y \cdot z\right)\\ \mathbf{elif}\;z \leq -1.45 \cdot 10^{+66}:\\ \;\;\;\;x \cdot \left(z \cdot -6\right)\\ \mathbf{elif}\;z \leq -9 \cdot 10^{-80}:\\ \;\;\;\;6 \cdot \left(y \cdot z\right)\\ \mathbf{elif}\;z \leq 3.3 \cdot 10^{-25}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 1.45 \cdot 10^{+73} \lor \neg \left(z \leq 3.8 \cdot 10^{+133}\right) \land z \leq 3.7 \cdot 10^{+287}:\\ \;\;\;\;6 \cdot \left(y \cdot z\right)\\ \mathbf{else}:\\ \;\;\;\;-6 \cdot \left(x \cdot z\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 60.9% accurate, 0.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := 6 \cdot \left(y \cdot z\right)\\ \mathbf{if}\;z \leq -5 \cdot 10^{+232}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;z \leq -7.5 \cdot 10^{+70}:\\ \;\;\;\;x \cdot \left(z \cdot -6\right)\\ \mathbf{elif}\;z \leq -1.1 \cdot 10^{-79}:\\ \;\;\;\;y \cdot \left(6 \cdot z\right)\\ \mathbf{elif}\;z \leq 6 \cdot 10^{-23}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 6.8 \cdot 10^{+72} \lor \neg \left(z \leq 1.85 \cdot 10^{+146}\right) \land z \leq 1.05 \cdot 10^{+286}:\\ \;\;\;\;t\_0\\ \mathbf{else}:\\ \;\;\;\;-6 \cdot \left(x \cdot z\right)\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (let* ((t_0 (* 6.0 (* y z))))
   (if (<= z -5e+232)
     t_0
     (if (<= z -7.5e+70)
       (* x (* z -6.0))
       (if (<= z -1.1e-79)
         (* y (* 6.0 z))
         (if (<= z 6e-23)
           x
           (if (or (<= z 6.8e+72)
                   (and (not (<= z 1.85e+146)) (<= z 1.05e+286)))
             t_0
             (* -6.0 (* x z)))))))))
double code(double x, double y, double z) {
	double t_0 = 6.0 * (y * z);
	double tmp;
	if (z <= -5e+232) {
		tmp = t_0;
	} else if (z <= -7.5e+70) {
		tmp = x * (z * -6.0);
	} else if (z <= -1.1e-79) {
		tmp = y * (6.0 * z);
	} else if (z <= 6e-23) {
		tmp = x;
	} else if ((z <= 6.8e+72) || (!(z <= 1.85e+146) && (z <= 1.05e+286))) {
		tmp = t_0;
	} else {
		tmp = -6.0 * (x * z);
	}
	return tmp;
}
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8) :: t_0
    real(8) :: tmp
    t_0 = 6.0d0 * (y * z)
    if (z <= (-5d+232)) then
        tmp = t_0
    else if (z <= (-7.5d+70)) then
        tmp = x * (z * (-6.0d0))
    else if (z <= (-1.1d-79)) then
        tmp = y * (6.0d0 * z)
    else if (z <= 6d-23) then
        tmp = x
    else if ((z <= 6.8d+72) .or. (.not. (z <= 1.85d+146)) .and. (z <= 1.05d+286)) then
        tmp = t_0
    else
        tmp = (-6.0d0) * (x * z)
    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 <= -5e+232) {
		tmp = t_0;
	} else if (z <= -7.5e+70) {
		tmp = x * (z * -6.0);
	} else if (z <= -1.1e-79) {
		tmp = y * (6.0 * z);
	} else if (z <= 6e-23) {
		tmp = x;
	} else if ((z <= 6.8e+72) || (!(z <= 1.85e+146) && (z <= 1.05e+286))) {
		tmp = t_0;
	} else {
		tmp = -6.0 * (x * z);
	}
	return tmp;
}
def code(x, y, z):
	t_0 = 6.0 * (y * z)
	tmp = 0
	if z <= -5e+232:
		tmp = t_0
	elif z <= -7.5e+70:
		tmp = x * (z * -6.0)
	elif z <= -1.1e-79:
		tmp = y * (6.0 * z)
	elif z <= 6e-23:
		tmp = x
	elif (z <= 6.8e+72) or (not (z <= 1.85e+146) and (z <= 1.05e+286)):
		tmp = t_0
	else:
		tmp = -6.0 * (x * z)
	return tmp
function code(x, y, z)
	t_0 = Float64(6.0 * Float64(y * z))
	tmp = 0.0
	if (z <= -5e+232)
		tmp = t_0;
	elseif (z <= -7.5e+70)
		tmp = Float64(x * Float64(z * -6.0));
	elseif (z <= -1.1e-79)
		tmp = Float64(y * Float64(6.0 * z));
	elseif (z <= 6e-23)
		tmp = x;
	elseif ((z <= 6.8e+72) || (!(z <= 1.85e+146) && (z <= 1.05e+286)))
		tmp = t_0;
	else
		tmp = Float64(-6.0 * Float64(x * z));
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	t_0 = 6.0 * (y * z);
	tmp = 0.0;
	if (z <= -5e+232)
		tmp = t_0;
	elseif (z <= -7.5e+70)
		tmp = x * (z * -6.0);
	elseif (z <= -1.1e-79)
		tmp = y * (6.0 * z);
	elseif (z <= 6e-23)
		tmp = x;
	elseif ((z <= 6.8e+72) || (~((z <= 1.85e+146)) && (z <= 1.05e+286)))
		tmp = t_0;
	else
		tmp = -6.0 * (x * z);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := Block[{t$95$0 = N[(6.0 * N[(y * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -5e+232], t$95$0, If[LessEqual[z, -7.5e+70], N[(x * N[(z * -6.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -1.1e-79], N[(y * N[(6.0 * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 6e-23], x, If[Or[LessEqual[z, 6.8e+72], And[N[Not[LessEqual[z, 1.85e+146]], $MachinePrecision], LessEqual[z, 1.05e+286]]], t$95$0, N[(-6.0 * N[(x * z), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}

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

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

\mathbf{elif}\;z \leq -1.1 \cdot 10^{-79}:\\
\;\;\;\;y \cdot \left(6 \cdot z\right)\\

\mathbf{elif}\;z \leq 6 \cdot 10^{-23}:\\
\;\;\;\;x\\

\mathbf{elif}\;z \leq 6.8 \cdot 10^{+72} \lor \neg \left(z \leq 1.85 \cdot 10^{+146}\right) \land z \leq 1.05 \cdot 10^{+286}:\\
\;\;\;\;t\_0\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if z < -4.99999999999999987e232 or 6.00000000000000006e-23 < z < 6.7999999999999997e72 or 1.85000000000000002e146 < z < 1.05e286

    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.8%

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

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

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

        \[\leadsto \color{blue}{\left(\left(y - x\right) \cdot z\right) \cdot 6} + x \]
      5. fma-define99.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 63.9%

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

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

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

    if -4.99999999999999987e232 < z < -7.50000000000000031e70

    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.8%

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

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

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

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

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

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

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

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

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

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

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

    if -7.50000000000000031e70 < z < -1.0999999999999999e-79

    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.4%

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

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

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

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

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

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

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

    if -1.0999999999999999e-79 < z < 6.00000000000000006e-23

    1. Initial program 99.1%

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

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

    if 6.7999999999999997e72 < z < 1.85000000000000002e146 or 1.05e286 < z

    1. Initial program 99.9%

      \[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.7%

        \[\leadsto \color{blue}{\left(\left(y - x\right) \cdot z\right) \cdot 6} + x \]
      5. fma-define99.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 99.7%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -5 \cdot 10^{+232}:\\ \;\;\;\;6 \cdot \left(y \cdot z\right)\\ \mathbf{elif}\;z \leq -7.5 \cdot 10^{+70}:\\ \;\;\;\;x \cdot \left(z \cdot -6\right)\\ \mathbf{elif}\;z \leq -1.1 \cdot 10^{-79}:\\ \;\;\;\;y \cdot \left(6 \cdot z\right)\\ \mathbf{elif}\;z \leq 6 \cdot 10^{-23}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 6.8 \cdot 10^{+72} \lor \neg \left(z \leq 1.85 \cdot 10^{+146}\right) \land z \leq 1.05 \cdot 10^{+286}:\\ \;\;\;\;6 \cdot \left(y \cdot z\right)\\ \mathbf{else}:\\ \;\;\;\;-6 \cdot \left(x \cdot z\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 60.9% accurate, 0.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := 6 \cdot \left(y \cdot z\right)\\ \mathbf{if}\;z \leq -1.7 \cdot 10^{+232}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;z \leq -2.75 \cdot 10^{+69}:\\ \;\;\;\;x \cdot \left(z \cdot -6\right)\\ \mathbf{elif}\;z \leq -1 \cdot 10^{-79}:\\ \;\;\;\;y \cdot \left(6 \cdot z\right)\\ \mathbf{elif}\;z \leq 2.7 \cdot 10^{-23}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 1.9 \cdot 10^{+73}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;z \leq 7.5 \cdot 10^{+143}:\\ \;\;\;\;z \cdot \left(x \cdot -6\right)\\ \mathbf{elif}\;z \leq 1.05 \cdot 10^{+291}:\\ \;\;\;\;t\_0\\ \mathbf{else}:\\ \;\;\;\;-6 \cdot \left(x \cdot z\right)\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (let* ((t_0 (* 6.0 (* y z))))
   (if (<= z -1.7e+232)
     t_0
     (if (<= z -2.75e+69)
       (* x (* z -6.0))
       (if (<= z -1e-79)
         (* y (* 6.0 z))
         (if (<= z 2.7e-23)
           x
           (if (<= z 1.9e+73)
             t_0
             (if (<= z 7.5e+143)
               (* z (* x -6.0))
               (if (<= z 1.05e+291) t_0 (* -6.0 (* x z)))))))))))
double code(double x, double y, double z) {
	double t_0 = 6.0 * (y * z);
	double tmp;
	if (z <= -1.7e+232) {
		tmp = t_0;
	} else if (z <= -2.75e+69) {
		tmp = x * (z * -6.0);
	} else if (z <= -1e-79) {
		tmp = y * (6.0 * z);
	} else if (z <= 2.7e-23) {
		tmp = x;
	} else if (z <= 1.9e+73) {
		tmp = t_0;
	} else if (z <= 7.5e+143) {
		tmp = z * (x * -6.0);
	} else if (z <= 1.05e+291) {
		tmp = t_0;
	} else {
		tmp = -6.0 * (x * z);
	}
	return tmp;
}
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8) :: t_0
    real(8) :: tmp
    t_0 = 6.0d0 * (y * z)
    if (z <= (-1.7d+232)) then
        tmp = t_0
    else if (z <= (-2.75d+69)) then
        tmp = x * (z * (-6.0d0))
    else if (z <= (-1d-79)) then
        tmp = y * (6.0d0 * z)
    else if (z <= 2.7d-23) then
        tmp = x
    else if (z <= 1.9d+73) then
        tmp = t_0
    else if (z <= 7.5d+143) then
        tmp = z * (x * (-6.0d0))
    else if (z <= 1.05d+291) then
        tmp = t_0
    else
        tmp = (-6.0d0) * (x * z)
    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 <= -1.7e+232) {
		tmp = t_0;
	} else if (z <= -2.75e+69) {
		tmp = x * (z * -6.0);
	} else if (z <= -1e-79) {
		tmp = y * (6.0 * z);
	} else if (z <= 2.7e-23) {
		tmp = x;
	} else if (z <= 1.9e+73) {
		tmp = t_0;
	} else if (z <= 7.5e+143) {
		tmp = z * (x * -6.0);
	} else if (z <= 1.05e+291) {
		tmp = t_0;
	} else {
		tmp = -6.0 * (x * z);
	}
	return tmp;
}
def code(x, y, z):
	t_0 = 6.0 * (y * z)
	tmp = 0
	if z <= -1.7e+232:
		tmp = t_0
	elif z <= -2.75e+69:
		tmp = x * (z * -6.0)
	elif z <= -1e-79:
		tmp = y * (6.0 * z)
	elif z <= 2.7e-23:
		tmp = x
	elif z <= 1.9e+73:
		tmp = t_0
	elif z <= 7.5e+143:
		tmp = z * (x * -6.0)
	elif z <= 1.05e+291:
		tmp = t_0
	else:
		tmp = -6.0 * (x * z)
	return tmp
function code(x, y, z)
	t_0 = Float64(6.0 * Float64(y * z))
	tmp = 0.0
	if (z <= -1.7e+232)
		tmp = t_0;
	elseif (z <= -2.75e+69)
		tmp = Float64(x * Float64(z * -6.0));
	elseif (z <= -1e-79)
		tmp = Float64(y * Float64(6.0 * z));
	elseif (z <= 2.7e-23)
		tmp = x;
	elseif (z <= 1.9e+73)
		tmp = t_0;
	elseif (z <= 7.5e+143)
		tmp = Float64(z * Float64(x * -6.0));
	elseif (z <= 1.05e+291)
		tmp = t_0;
	else
		tmp = Float64(-6.0 * Float64(x * z));
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	t_0 = 6.0 * (y * z);
	tmp = 0.0;
	if (z <= -1.7e+232)
		tmp = t_0;
	elseif (z <= -2.75e+69)
		tmp = x * (z * -6.0);
	elseif (z <= -1e-79)
		tmp = y * (6.0 * z);
	elseif (z <= 2.7e-23)
		tmp = x;
	elseif (z <= 1.9e+73)
		tmp = t_0;
	elseif (z <= 7.5e+143)
		tmp = z * (x * -6.0);
	elseif (z <= 1.05e+291)
		tmp = t_0;
	else
		tmp = -6.0 * (x * z);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := Block[{t$95$0 = N[(6.0 * N[(y * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.7e+232], t$95$0, If[LessEqual[z, -2.75e+69], N[(x * N[(z * -6.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -1e-79], N[(y * N[(6.0 * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.7e-23], x, If[LessEqual[z, 1.9e+73], t$95$0, If[LessEqual[z, 7.5e+143], N[(z * N[(x * -6.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.05e+291], t$95$0, N[(-6.0 * N[(x * z), $MachinePrecision]), $MachinePrecision]]]]]]]]]
\begin{array}{l}

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

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

\mathbf{elif}\;z \leq -1 \cdot 10^{-79}:\\
\;\;\;\;y \cdot \left(6 \cdot z\right)\\

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

\mathbf{elif}\;z \leq 1.9 \cdot 10^{+73}:\\
\;\;\;\;t\_0\\

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

\mathbf{elif}\;z \leq 1.05 \cdot 10^{+291}:\\
\;\;\;\;t\_0\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 6 regimes
  2. if z < -1.6999999999999999e232 or 2.69999999999999985e-23 < z < 1.90000000000000011e73 or 7.49999999999999974e143 < z < 1.05e291

    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.8%

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

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

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

        \[\leadsto \color{blue}{\left(\left(y - x\right) \cdot z\right) \cdot 6} + x \]
      5. fma-define99.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 63.9%

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

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

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

    if -1.6999999999999999e232 < z < -2.75000000000000001e69

    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.8%

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

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

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

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

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

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

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

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

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

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

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

    if -2.75000000000000001e69 < z < -1e-79

    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.4%

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

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

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

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

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

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

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

    if -1e-79 < z < 2.69999999999999985e-23

    1. Initial program 99.1%

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

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

    if 1.90000000000000011e73 < z < 7.49999999999999974e143

    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.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.6%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{z \cdot \left(-6 \cdot x\right)} \]
    11. Simplified65.5%

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

    if 1.05e291 < z

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.7 \cdot 10^{+232}:\\ \;\;\;\;6 \cdot \left(y \cdot z\right)\\ \mathbf{elif}\;z \leq -2.75 \cdot 10^{+69}:\\ \;\;\;\;x \cdot \left(z \cdot -6\right)\\ \mathbf{elif}\;z \leq -1 \cdot 10^{-79}:\\ \;\;\;\;y \cdot \left(6 \cdot z\right)\\ \mathbf{elif}\;z \leq 2.7 \cdot 10^{-23}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 1.9 \cdot 10^{+73}:\\ \;\;\;\;6 \cdot \left(y \cdot z\right)\\ \mathbf{elif}\;z \leq 7.5 \cdot 10^{+143}:\\ \;\;\;\;z \cdot \left(x \cdot -6\right)\\ \mathbf{elif}\;z \leq 1.05 \cdot 10^{+291}:\\ \;\;\;\;6 \cdot \left(y \cdot z\right)\\ \mathbf{else}:\\ \;\;\;\;-6 \cdot \left(x \cdot z\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 61.0% accurate, 0.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := 6 \cdot \left(y \cdot z\right)\\ \mathbf{if}\;z \leq -1.22 \cdot 10^{+232}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;z \leq -2.65 \cdot 10^{+73}:\\ \;\;\;\;x \cdot \left(z \cdot -6\right)\\ \mathbf{elif}\;z \leq -1.1 \cdot 10^{-79}:\\ \;\;\;\;z \cdot \left(y \cdot 6\right)\\ \mathbf{elif}\;z \leq 2.75 \cdot 10^{-24}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 7 \cdot 10^{+72}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;z \leq 3.4 \cdot 10^{+133}:\\ \;\;\;\;z \cdot \left(x \cdot -6\right)\\ \mathbf{elif}\;z \leq 2 \cdot 10^{+291}:\\ \;\;\;\;t\_0\\ \mathbf{else}:\\ \;\;\;\;-6 \cdot \left(x \cdot z\right)\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (let* ((t_0 (* 6.0 (* y z))))
   (if (<= z -1.22e+232)
     t_0
     (if (<= z -2.65e+73)
       (* x (* z -6.0))
       (if (<= z -1.1e-79)
         (* z (* y 6.0))
         (if (<= z 2.75e-24)
           x
           (if (<= z 7e+72)
             t_0
             (if (<= z 3.4e+133)
               (* z (* x -6.0))
               (if (<= z 2e+291) t_0 (* -6.0 (* x z)))))))))))
double code(double x, double y, double z) {
	double t_0 = 6.0 * (y * z);
	double tmp;
	if (z <= -1.22e+232) {
		tmp = t_0;
	} else if (z <= -2.65e+73) {
		tmp = x * (z * -6.0);
	} else if (z <= -1.1e-79) {
		tmp = z * (y * 6.0);
	} else if (z <= 2.75e-24) {
		tmp = x;
	} else if (z <= 7e+72) {
		tmp = t_0;
	} else if (z <= 3.4e+133) {
		tmp = z * (x * -6.0);
	} else if (z <= 2e+291) {
		tmp = t_0;
	} else {
		tmp = -6.0 * (x * z);
	}
	return tmp;
}
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8) :: t_0
    real(8) :: tmp
    t_0 = 6.0d0 * (y * z)
    if (z <= (-1.22d+232)) then
        tmp = t_0
    else if (z <= (-2.65d+73)) then
        tmp = x * (z * (-6.0d0))
    else if (z <= (-1.1d-79)) then
        tmp = z * (y * 6.0d0)
    else if (z <= 2.75d-24) then
        tmp = x
    else if (z <= 7d+72) then
        tmp = t_0
    else if (z <= 3.4d+133) then
        tmp = z * (x * (-6.0d0))
    else if (z <= 2d+291) then
        tmp = t_0
    else
        tmp = (-6.0d0) * (x * z)
    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 <= -1.22e+232) {
		tmp = t_0;
	} else if (z <= -2.65e+73) {
		tmp = x * (z * -6.0);
	} else if (z <= -1.1e-79) {
		tmp = z * (y * 6.0);
	} else if (z <= 2.75e-24) {
		tmp = x;
	} else if (z <= 7e+72) {
		tmp = t_0;
	} else if (z <= 3.4e+133) {
		tmp = z * (x * -6.0);
	} else if (z <= 2e+291) {
		tmp = t_0;
	} else {
		tmp = -6.0 * (x * z);
	}
	return tmp;
}
def code(x, y, z):
	t_0 = 6.0 * (y * z)
	tmp = 0
	if z <= -1.22e+232:
		tmp = t_0
	elif z <= -2.65e+73:
		tmp = x * (z * -6.0)
	elif z <= -1.1e-79:
		tmp = z * (y * 6.0)
	elif z <= 2.75e-24:
		tmp = x
	elif z <= 7e+72:
		tmp = t_0
	elif z <= 3.4e+133:
		tmp = z * (x * -6.0)
	elif z <= 2e+291:
		tmp = t_0
	else:
		tmp = -6.0 * (x * z)
	return tmp
function code(x, y, z)
	t_0 = Float64(6.0 * Float64(y * z))
	tmp = 0.0
	if (z <= -1.22e+232)
		tmp = t_0;
	elseif (z <= -2.65e+73)
		tmp = Float64(x * Float64(z * -6.0));
	elseif (z <= -1.1e-79)
		tmp = Float64(z * Float64(y * 6.0));
	elseif (z <= 2.75e-24)
		tmp = x;
	elseif (z <= 7e+72)
		tmp = t_0;
	elseif (z <= 3.4e+133)
		tmp = Float64(z * Float64(x * -6.0));
	elseif (z <= 2e+291)
		tmp = t_0;
	else
		tmp = Float64(-6.0 * Float64(x * z));
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	t_0 = 6.0 * (y * z);
	tmp = 0.0;
	if (z <= -1.22e+232)
		tmp = t_0;
	elseif (z <= -2.65e+73)
		tmp = x * (z * -6.0);
	elseif (z <= -1.1e-79)
		tmp = z * (y * 6.0);
	elseif (z <= 2.75e-24)
		tmp = x;
	elseif (z <= 7e+72)
		tmp = t_0;
	elseif (z <= 3.4e+133)
		tmp = z * (x * -6.0);
	elseif (z <= 2e+291)
		tmp = t_0;
	else
		tmp = -6.0 * (x * z);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := Block[{t$95$0 = N[(6.0 * N[(y * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.22e+232], t$95$0, If[LessEqual[z, -2.65e+73], N[(x * N[(z * -6.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -1.1e-79], N[(z * N[(y * 6.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.75e-24], x, If[LessEqual[z, 7e+72], t$95$0, If[LessEqual[z, 3.4e+133], N[(z * N[(x * -6.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2e+291], t$95$0, N[(-6.0 * N[(x * z), $MachinePrecision]), $MachinePrecision]]]]]]]]]
\begin{array}{l}

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

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

\mathbf{elif}\;z \leq -1.1 \cdot 10^{-79}:\\
\;\;\;\;z \cdot \left(y \cdot 6\right)\\

\mathbf{elif}\;z \leq 2.75 \cdot 10^{-24}:\\
\;\;\;\;x\\

\mathbf{elif}\;z \leq 7 \cdot 10^{+72}:\\
\;\;\;\;t\_0\\

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

\mathbf{elif}\;z \leq 2 \cdot 10^{+291}:\\
\;\;\;\;t\_0\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 6 regimes
  2. if z < -1.21999999999999994e232 or 2.7499999999999999e-24 < z < 7.0000000000000002e72 or 3.39999999999999987e133 < z < 1.9999999999999999e291

    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.8%

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

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

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

        \[\leadsto \color{blue}{\left(\left(y - x\right) \cdot z\right) \cdot 6} + x \]
      5. fma-define99.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 63.9%

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

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

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

    if -1.21999999999999994e232 < z < -2.64999999999999998e73

    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.8%

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

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

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

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

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

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

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

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

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

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

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

    if -2.64999999999999998e73 < z < -1.0999999999999999e-79

    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.4%

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

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

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

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

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

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

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

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

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

    if -1.0999999999999999e-79 < z < 2.7499999999999999e-24

    1. Initial program 99.1%

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

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

    if 7.0000000000000002e72 < z < 3.39999999999999987e133

    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.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.6%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{z \cdot \left(-6 \cdot x\right)} \]
    11. Simplified65.5%

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

    if 1.9999999999999999e291 < z

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.22 \cdot 10^{+232}:\\ \;\;\;\;6 \cdot \left(y \cdot z\right)\\ \mathbf{elif}\;z \leq -2.65 \cdot 10^{+73}:\\ \;\;\;\;x \cdot \left(z \cdot -6\right)\\ \mathbf{elif}\;z \leq -1.1 \cdot 10^{-79}:\\ \;\;\;\;z \cdot \left(y \cdot 6\right)\\ \mathbf{elif}\;z \leq 2.75 \cdot 10^{-24}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 7 \cdot 10^{+72}:\\ \;\;\;\;6 \cdot \left(y \cdot z\right)\\ \mathbf{elif}\;z \leq 3.4 \cdot 10^{+133}:\\ \;\;\;\;z \cdot \left(x \cdot -6\right)\\ \mathbf{elif}\;z \leq 2 \cdot 10^{+291}:\\ \;\;\;\;6 \cdot \left(y \cdot z\right)\\ \mathbf{else}:\\ \;\;\;\;-6 \cdot \left(x \cdot z\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 8: 83.9% accurate, 0.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.6 \cdot 10^{-83} \lor \neg \left(z \leq 4.4 \cdot 10^{-24}\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.6000000000000001e-83 or 4.40000000000000003e-24 < 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.8%

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

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

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

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

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

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

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

    if -1.6000000000000001e-83 < z < 4.40000000000000003e-24

    1. Initial program 99.1%

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

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

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

Alternative 9: 83.9% accurate, 0.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.55 \cdot 10^{-82} \lor \neg \left(z \leq 1.02 \cdot 10^{-22}\right):\\
\;\;\;\;\left(y - x\right) \cdot \left(6 \cdot z\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -1.55e-82 or 1.02000000000000002e-22 < 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.8%

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

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

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

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

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

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

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

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

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

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

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

    if -1.55e-82 < z < 1.02000000000000002e-22

    1. Initial program 99.1%

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

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

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

Alternative 10: 83.9% accurate, 0.5× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -7.00000000000000061e-83 or 8.5000000000000002e-24 < 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.8%

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

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

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

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

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

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

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

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

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

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

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

    if -7.00000000000000061e-83 < z < 8.5000000000000002e-24

    1. Initial program 99.1%

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

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

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

Alternative 11: 98.6% accurate, 0.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -44000000000000 \lor \neg \left(z \leq 0.17\right):\\
\;\;\;\;\left(y - x\right) \cdot \left(6 \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 < -4.4e13 or 0.170000000000000012 < 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.6%

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

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

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

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

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

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

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

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

    if -4.4e13 < z < 0.170000000000000012

    1. Initial program 99.2%

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

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

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

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

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

Alternative 12: 98.5% accurate, 0.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -44000000000000 \lor \neg \left(z \leq 0.17\right):\\
\;\;\;\;\left(y - x\right) \cdot \left(6 \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 < -4.4e13 or 0.170000000000000012 < 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.6%

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

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

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

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

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

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

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

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

    if -4.4e13 < z < 0.170000000000000012

    1. Initial program 99.2%

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

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

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

Alternative 13: 61.0% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -44000000000000 \lor \neg \left(z \leq 0.17\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 < -4.4e13 or 0.170000000000000012 < 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.6%

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

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

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

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

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

    if -4.4e13 < z < 0.170000000000000012

    1. Initial program 99.2%

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

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

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

Alternative 14: 99.7% accurate, 1.0× speedup?

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

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

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

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

Alternative 15: 99.8% accurate, 1.0× speedup?

\[\begin{array}{l} \\ x + \left(y - x\right) \cdot \left(6 \cdot z\right) \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(y - x) * Float64(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[(y - x), $MachinePrecision] * N[(6.0 * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

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

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

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

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

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

Alternative 16: 37.0% 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.5%

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

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

    \[\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 2024044 
(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)))