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

Percentage Accurate: 99.5% → 99.8%
Time: 18.1s
Alternatives: 17
Speedup: 1.2×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

The average percentage accuracy by input value. Horizontal axis shows value of an input variable; the variable is choosen in the title. Vertical axis is accuracy; higher is better. Red represent the original program, while blue represents Herbie's suggestion. These can be toggled with buttons below the plot. The line is an average while dots represent individual samples.

Accuracy vs Speed?

Herbie found 17 alternatives:

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

Initial Program: 99.5% accurate, 1.0× speedup?

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

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

Alternative 1: 99.8% accurate, 0.1× speedup?

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

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

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

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

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

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

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

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

      \[\leadsto \mathsf{fma}\left(y - x, \color{blue}{6 \cdot \left(-z\right) + 6 \cdot \frac{2}{3}}, x\right) \]
    7. distribute-rgt-neg-out99.7%

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

      \[\leadsto \mathsf{fma}\left(y - x, \left(-\color{blue}{z \cdot 6}\right) + 6 \cdot \frac{2}{3}, x\right) \]
    9. distribute-rgt-neg-in99.7%

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

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

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

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

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

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

Alternative 2: 99.8% accurate, 0.1× speedup?

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

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

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

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

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

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

      \[\leadsto \mathsf{fma}\left(y - x, 6 \cdot \color{blue}{\left(\frac{2}{3} + \left(-z\right)\right)}, x\right) \]
    5. distribute-rgt-in99.7%

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

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

      \[\leadsto \mathsf{fma}\left(y - x, \color{blue}{4} + \left(-z\right) \cdot 6, x\right) \]
    8. distribute-lft-neg-out99.7%

      \[\leadsto \mathsf{fma}\left(y - x, 4 + \color{blue}{\left(-z \cdot 6\right)}, x\right) \]
    9. distribute-rgt-neg-in99.7%

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

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

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

Alternative 3: 51.0% accurate, 0.4× speedup?

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

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

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

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

\mathbf{elif}\;z \leq 6.4 \cdot 10^{-125}:\\
\;\;\;\;y \cdot 4\\

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

\mathbf{elif}\;z \leq 4.5 \cdot 10^{+182}:\\
\;\;\;\;6 \cdot \left(x \cdot z\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 6 regimes
  2. if z < -1.8500000000000001e194

    1. Initial program 99.9%

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

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

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

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

        \[\leadsto \mathsf{fma}\left(y - x, 6 \cdot \color{blue}{\left(\frac{2}{3} + \left(-z\right)\right)}, x\right) \]
      5. distribute-rgt-in99.8%

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

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

        \[\leadsto \mathsf{fma}\left(y - x, \color{blue}{4} + \left(-z\right) \cdot 6, x\right) \]
      8. distribute-lft-neg-out99.8%

        \[\leadsto \mathsf{fma}\left(y - x, 4 + \color{blue}{\left(-z \cdot 6\right)}, x\right) \]
      9. distribute-rgt-neg-in99.8%

        \[\leadsto \mathsf{fma}\left(y - x, 4 + \color{blue}{z \cdot \left(-6\right)}, x\right) \]
      10. metadata-eval99.8%

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

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

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

        \[\leadsto \color{blue}{1 \cdot x} + -1 \cdot \left(x \cdot \left(4 + -6 \cdot z\right)\right) \]
      2. *-commutative63.2%

        \[\leadsto 1 \cdot x + -1 \cdot \color{blue}{\left(\left(4 + -6 \cdot z\right) \cdot x\right)} \]
      3. +-commutative63.2%

        \[\leadsto 1 \cdot x + -1 \cdot \left(\color{blue}{\left(-6 \cdot z + 4\right)} \cdot x\right) \]
      4. *-commutative63.2%

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

        \[\leadsto 1 \cdot x + -1 \cdot \left(\color{blue}{\mathsf{fma}\left(z, -6, 4\right)} \cdot x\right) \]
      6. associate-*r*63.3%

        \[\leadsto 1 \cdot x + \color{blue}{\left(-1 \cdot \mathsf{fma}\left(z, -6, 4\right)\right) \cdot x} \]
      7. neg-mul-163.3%

        \[\leadsto 1 \cdot x + \color{blue}{\left(-\mathsf{fma}\left(z, -6, 4\right)\right)} \cdot x \]
      8. fma-define63.2%

        \[\leadsto 1 \cdot x + \left(-\color{blue}{\left(z \cdot -6 + 4\right)}\right) \cdot x \]
      9. distribute-neg-in63.2%

        \[\leadsto 1 \cdot x + \color{blue}{\left(\left(-z \cdot -6\right) + \left(-4\right)\right)} \cdot x \]
      10. distribute-lft-neg-in63.2%

        \[\leadsto 1 \cdot x + \left(\color{blue}{\left(-z\right) \cdot -6} + \left(-4\right)\right) \cdot x \]
      11. metadata-eval63.2%

        \[\leadsto 1 \cdot x + \left(\left(-z\right) \cdot -6 + \color{blue}{-4}\right) \cdot x \]
      12. metadata-eval63.2%

        \[\leadsto 1 \cdot x + \left(\left(-z\right) \cdot -6 + \color{blue}{0.6666666666666666 \cdot -6}\right) \cdot x \]
      13. distribute-rgt-in63.2%

        \[\leadsto 1 \cdot x + \color{blue}{\left(-6 \cdot \left(\left(-z\right) + 0.6666666666666666\right)\right)} \cdot x \]
      14. +-commutative63.2%

        \[\leadsto 1 \cdot x + \left(-6 \cdot \color{blue}{\left(0.6666666666666666 + \left(-z\right)\right)}\right) \cdot x \]
      15. sub-neg63.2%

        \[\leadsto 1 \cdot x + \left(-6 \cdot \color{blue}{\left(0.6666666666666666 - z\right)}\right) \cdot x \]
      16. distribute-rgt-in63.2%

        \[\leadsto \color{blue}{x \cdot \left(1 + -6 \cdot \left(0.6666666666666666 - z\right)\right)} \]
      17. sub-neg63.2%

        \[\leadsto x \cdot \left(1 + -6 \cdot \color{blue}{\left(0.6666666666666666 + \left(-z\right)\right)}\right) \]
      18. distribute-rgt-in63.2%

        \[\leadsto x \cdot \left(1 + \color{blue}{\left(0.6666666666666666 \cdot -6 + \left(-z\right) \cdot -6\right)}\right) \]
      19. metadata-eval63.2%

        \[\leadsto x \cdot \left(1 + \left(\color{blue}{-4} + \left(-z\right) \cdot -6\right)\right) \]
      20. distribute-lft-neg-in63.2%

        \[\leadsto x \cdot \left(1 + \left(-4 + \color{blue}{\left(-z \cdot -6\right)}\right)\right) \]
      21. associate-+r+63.2%

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

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

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

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

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

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

    if -1.8500000000000001e194 < z < -0.11799999999999999

    1. Initial program 99.7%

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

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

      \[\leadsto \color{blue}{x + \left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right)} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. add-sqr-sqrt47.4%

        \[\leadsto \color{blue}{\sqrt{x} \cdot \sqrt{x}} + \left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right) \]
      2. fma-define47.4%

        \[\leadsto \color{blue}{\mathsf{fma}\left(\sqrt{x}, \sqrt{x}, \left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right)\right)} \]
      3. associate-*l*47.3%

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

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

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

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

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

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

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

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

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

    if -0.11799999999999999 < z < -3.99999999999999997e-299 or 6.3999999999999997e-125 < z < 1.39999999999999994e-6

    1. Initial program 99.2%

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

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

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

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

        \[\leadsto \mathsf{fma}\left(y - x, 6 \cdot \color{blue}{\left(\frac{2}{3} + \left(-z\right)\right)}, x\right) \]
      5. distribute-rgt-in99.7%

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

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

        \[\leadsto \mathsf{fma}\left(y - x, \color{blue}{4} + \left(-z\right) \cdot 6, x\right) \]
      8. distribute-lft-neg-out99.7%

        \[\leadsto \mathsf{fma}\left(y - x, 4 + \color{blue}{\left(-z \cdot 6\right)}, x\right) \]
      9. distribute-rgt-neg-in99.7%

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

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

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

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

        \[\leadsto \color{blue}{1 \cdot x} + -1 \cdot \left(x \cdot \left(4 + -6 \cdot z\right)\right) \]
      2. *-commutative57.6%

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

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

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

        \[\leadsto 1 \cdot x + -1 \cdot \left(\color{blue}{\mathsf{fma}\left(z, -6, 4\right)} \cdot x\right) \]
      6. associate-*r*57.6%

        \[\leadsto 1 \cdot x + \color{blue}{\left(-1 \cdot \mathsf{fma}\left(z, -6, 4\right)\right) \cdot x} \]
      7. neg-mul-157.6%

        \[\leadsto 1 \cdot x + \color{blue}{\left(-\mathsf{fma}\left(z, -6, 4\right)\right)} \cdot x \]
      8. fma-define57.6%

        \[\leadsto 1 \cdot x + \left(-\color{blue}{\left(z \cdot -6 + 4\right)}\right) \cdot x \]
      9. distribute-neg-in57.6%

        \[\leadsto 1 \cdot x + \color{blue}{\left(\left(-z \cdot -6\right) + \left(-4\right)\right)} \cdot x \]
      10. distribute-lft-neg-in57.6%

        \[\leadsto 1 \cdot x + \left(\color{blue}{\left(-z\right) \cdot -6} + \left(-4\right)\right) \cdot x \]
      11. metadata-eval57.6%

        \[\leadsto 1 \cdot x + \left(\left(-z\right) \cdot -6 + \color{blue}{-4}\right) \cdot x \]
      12. metadata-eval57.6%

        \[\leadsto 1 \cdot x + \left(\left(-z\right) \cdot -6 + \color{blue}{0.6666666666666666 \cdot -6}\right) \cdot x \]
      13. distribute-rgt-in57.5%

        \[\leadsto 1 \cdot x + \color{blue}{\left(-6 \cdot \left(\left(-z\right) + 0.6666666666666666\right)\right)} \cdot x \]
      14. +-commutative57.5%

        \[\leadsto 1 \cdot x + \left(-6 \cdot \color{blue}{\left(0.6666666666666666 + \left(-z\right)\right)}\right) \cdot x \]
      15. sub-neg57.5%

        \[\leadsto 1 \cdot x + \left(-6 \cdot \color{blue}{\left(0.6666666666666666 - z\right)}\right) \cdot x \]
      16. distribute-rgt-in57.5%

        \[\leadsto \color{blue}{x \cdot \left(1 + -6 \cdot \left(0.6666666666666666 - z\right)\right)} \]
      17. sub-neg57.5%

        \[\leadsto x \cdot \left(1 + -6 \cdot \color{blue}{\left(0.6666666666666666 + \left(-z\right)\right)}\right) \]
      18. distribute-rgt-in57.6%

        \[\leadsto x \cdot \left(1 + \color{blue}{\left(0.6666666666666666 \cdot -6 + \left(-z\right) \cdot -6\right)}\right) \]
      19. metadata-eval57.6%

        \[\leadsto x \cdot \left(1 + \left(\color{blue}{-4} + \left(-z\right) \cdot -6\right)\right) \]
      20. distribute-lft-neg-in57.6%

        \[\leadsto x \cdot \left(1 + \left(-4 + \color{blue}{\left(-z \cdot -6\right)}\right)\right) \]
      21. associate-+r+57.6%

        \[\leadsto x \cdot \color{blue}{\left(\left(1 + -4\right) + \left(-z \cdot -6\right)\right)} \]
    7. Simplified57.6%

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

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

        \[\leadsto \color{blue}{x \cdot -3} \]
    10. Simplified57.3%

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

    if -3.99999999999999997e-299 < z < 6.3999999999999997e-125

    1. Initial program 99.3%

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

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

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

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

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

    if 1.39999999999999994e-6 < z < 4.50000000000000029e182

    1. Initial program 99.5%

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

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

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

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

        \[\leadsto \mathsf{fma}\left(y - x, 6 \cdot \color{blue}{\left(\frac{2}{3} + \left(-z\right)\right)}, x\right) \]
      5. distribute-rgt-in99.5%

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

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

        \[\leadsto \mathsf{fma}\left(y - x, \color{blue}{4} + \left(-z\right) \cdot 6, x\right) \]
      8. distribute-lft-neg-out99.5%

        \[\leadsto \mathsf{fma}\left(y - x, 4 + \color{blue}{\left(-z \cdot 6\right)}, x\right) \]
      9. distribute-rgt-neg-in99.5%

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

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

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

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

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

        \[\leadsto 1 \cdot x + -1 \cdot \color{blue}{\left(\left(4 + -6 \cdot z\right) \cdot x\right)} \]
      3. +-commutative57.5%

        \[\leadsto 1 \cdot x + -1 \cdot \left(\color{blue}{\left(-6 \cdot z + 4\right)} \cdot x\right) \]
      4. *-commutative57.5%

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

        \[\leadsto 1 \cdot x + -1 \cdot \left(\color{blue}{\mathsf{fma}\left(z, -6, 4\right)} \cdot x\right) \]
      6. associate-*r*57.5%

        \[\leadsto 1 \cdot x + \color{blue}{\left(-1 \cdot \mathsf{fma}\left(z, -6, 4\right)\right) \cdot x} \]
      7. neg-mul-157.5%

        \[\leadsto 1 \cdot x + \color{blue}{\left(-\mathsf{fma}\left(z, -6, 4\right)\right)} \cdot x \]
      8. fma-define57.5%

        \[\leadsto 1 \cdot x + \left(-\color{blue}{\left(z \cdot -6 + 4\right)}\right) \cdot x \]
      9. distribute-neg-in57.5%

        \[\leadsto 1 \cdot x + \color{blue}{\left(\left(-z \cdot -6\right) + \left(-4\right)\right)} \cdot x \]
      10. distribute-lft-neg-in57.5%

        \[\leadsto 1 \cdot x + \left(\color{blue}{\left(-z\right) \cdot -6} + \left(-4\right)\right) \cdot x \]
      11. metadata-eval57.5%

        \[\leadsto 1 \cdot x + \left(\left(-z\right) \cdot -6 + \color{blue}{-4}\right) \cdot x \]
      12. metadata-eval57.5%

        \[\leadsto 1 \cdot x + \left(\left(-z\right) \cdot -6 + \color{blue}{0.6666666666666666 \cdot -6}\right) \cdot x \]
      13. distribute-rgt-in57.5%

        \[\leadsto 1 \cdot x + \color{blue}{\left(-6 \cdot \left(\left(-z\right) + 0.6666666666666666\right)\right)} \cdot x \]
      14. +-commutative57.5%

        \[\leadsto 1 \cdot x + \left(-6 \cdot \color{blue}{\left(0.6666666666666666 + \left(-z\right)\right)}\right) \cdot x \]
      15. sub-neg57.5%

        \[\leadsto 1 \cdot x + \left(-6 \cdot \color{blue}{\left(0.6666666666666666 - z\right)}\right) \cdot x \]
      16. distribute-rgt-in57.6%

        \[\leadsto \color{blue}{x \cdot \left(1 + -6 \cdot \left(0.6666666666666666 - z\right)\right)} \]
      17. sub-neg57.6%

        \[\leadsto x \cdot \left(1 + -6 \cdot \color{blue}{\left(0.6666666666666666 + \left(-z\right)\right)}\right) \]
      18. distribute-rgt-in57.5%

        \[\leadsto x \cdot \left(1 + \color{blue}{\left(0.6666666666666666 \cdot -6 + \left(-z\right) \cdot -6\right)}\right) \]
      19. metadata-eval57.5%

        \[\leadsto x \cdot \left(1 + \left(\color{blue}{-4} + \left(-z\right) \cdot -6\right)\right) \]
      20. distribute-lft-neg-in57.5%

        \[\leadsto x \cdot \left(1 + \left(-4 + \color{blue}{\left(-z \cdot -6\right)}\right)\right) \]
      21. associate-+r+57.5%

        \[\leadsto x \cdot \color{blue}{\left(\left(1 + -4\right) + \left(-z \cdot -6\right)\right)} \]
    7. Simplified57.5%

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

      \[\leadsto x \cdot \color{blue}{\left(z \cdot \left(6 - 3 \cdot \frac{1}{z}\right)\right)} \]
    9. Step-by-step derivation
      1. associate-*r/57.5%

        \[\leadsto x \cdot \left(z \cdot \left(6 - \color{blue}{\frac{3 \cdot 1}{z}}\right)\right) \]
      2. metadata-eval57.5%

        \[\leadsto x \cdot \left(z \cdot \left(6 - \frac{\color{blue}{3}}{z}\right)\right) \]
    10. Simplified57.5%

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

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

    if 4.50000000000000029e182 < z

    1. Initial program 99.8%

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

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

      \[\leadsto \color{blue}{x + \left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right)} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. add-sqr-sqrt39.9%

        \[\leadsto \color{blue}{\sqrt{x} \cdot \sqrt{x}} + \left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right) \]
      2. fma-define39.9%

        \[\leadsto \color{blue}{\mathsf{fma}\left(\sqrt{x}, \sqrt{x}, \left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right)\right)} \]
      3. associate-*l*40.0%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.85 \cdot 10^{+194}:\\ \;\;\;\;z \cdot \left(x \cdot 6\right)\\ \mathbf{elif}\;z \leq -0.118:\\ \;\;\;\;z \cdot \left(y \cdot -6\right)\\ \mathbf{elif}\;z \leq -4 \cdot 10^{-299}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 6.4 \cdot 10^{-125}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 1.4 \cdot 10^{-6}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 4.5 \cdot 10^{+182}:\\ \;\;\;\;6 \cdot \left(x \cdot z\right)\\ \mathbf{else}:\\ \;\;\;\;-6 \cdot \left(y \cdot z\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 50.9% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := 6 \cdot \left(x \cdot z\right)\\ \mathbf{if}\;z \leq -5.1 \cdot 10^{+199}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;z \leq -0.22:\\ \;\;\;\;z \cdot \left(y \cdot -6\right)\\ \mathbf{elif}\;z \leq -6.6 \cdot 10^{-298}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 5 \cdot 10^{-125}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 1.4 \cdot 10^{-6}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 2 \cdot 10^{+184}:\\ \;\;\;\;t\_0\\ \mathbf{else}:\\ \;\;\;\;-6 \cdot \left(y \cdot z\right)\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (let* ((t_0 (* 6.0 (* x z))))
   (if (<= z -5.1e+199)
     t_0
     (if (<= z -0.22)
       (* z (* y -6.0))
       (if (<= z -6.6e-298)
         (* x -3.0)
         (if (<= z 5e-125)
           (* y 4.0)
           (if (<= z 1.4e-6)
             (* x -3.0)
             (if (<= z 2e+184) t_0 (* -6.0 (* y z))))))))))
double code(double x, double y, double z) {
	double t_0 = 6.0 * (x * z);
	double tmp;
	if (z <= -5.1e+199) {
		tmp = t_0;
	} else if (z <= -0.22) {
		tmp = z * (y * -6.0);
	} else if (z <= -6.6e-298) {
		tmp = x * -3.0;
	} else if (z <= 5e-125) {
		tmp = y * 4.0;
	} else if (z <= 1.4e-6) {
		tmp = x * -3.0;
	} else if (z <= 2e+184) {
		tmp = t_0;
	} else {
		tmp = -6.0 * (y * z);
	}
	return tmp;
}
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8) :: t_0
    real(8) :: tmp
    t_0 = 6.0d0 * (x * z)
    if (z <= (-5.1d+199)) then
        tmp = t_0
    else if (z <= (-0.22d0)) then
        tmp = z * (y * (-6.0d0))
    else if (z <= (-6.6d-298)) then
        tmp = x * (-3.0d0)
    else if (z <= 5d-125) then
        tmp = y * 4.0d0
    else if (z <= 1.4d-6) then
        tmp = x * (-3.0d0)
    else if (z <= 2d+184) then
        tmp = t_0
    else
        tmp = (-6.0d0) * (y * z)
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double t_0 = 6.0 * (x * z);
	double tmp;
	if (z <= -5.1e+199) {
		tmp = t_0;
	} else if (z <= -0.22) {
		tmp = z * (y * -6.0);
	} else if (z <= -6.6e-298) {
		tmp = x * -3.0;
	} else if (z <= 5e-125) {
		tmp = y * 4.0;
	} else if (z <= 1.4e-6) {
		tmp = x * -3.0;
	} else if (z <= 2e+184) {
		tmp = t_0;
	} else {
		tmp = -6.0 * (y * z);
	}
	return tmp;
}
def code(x, y, z):
	t_0 = 6.0 * (x * z)
	tmp = 0
	if z <= -5.1e+199:
		tmp = t_0
	elif z <= -0.22:
		tmp = z * (y * -6.0)
	elif z <= -6.6e-298:
		tmp = x * -3.0
	elif z <= 5e-125:
		tmp = y * 4.0
	elif z <= 1.4e-6:
		tmp = x * -3.0
	elif z <= 2e+184:
		tmp = t_0
	else:
		tmp = -6.0 * (y * z)
	return tmp
function code(x, y, z)
	t_0 = Float64(6.0 * Float64(x * z))
	tmp = 0.0
	if (z <= -5.1e+199)
		tmp = t_0;
	elseif (z <= -0.22)
		tmp = Float64(z * Float64(y * -6.0));
	elseif (z <= -6.6e-298)
		tmp = Float64(x * -3.0);
	elseif (z <= 5e-125)
		tmp = Float64(y * 4.0);
	elseif (z <= 1.4e-6)
		tmp = Float64(x * -3.0);
	elseif (z <= 2e+184)
		tmp = t_0;
	else
		tmp = Float64(-6.0 * Float64(y * z));
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	t_0 = 6.0 * (x * z);
	tmp = 0.0;
	if (z <= -5.1e+199)
		tmp = t_0;
	elseif (z <= -0.22)
		tmp = z * (y * -6.0);
	elseif (z <= -6.6e-298)
		tmp = x * -3.0;
	elseif (z <= 5e-125)
		tmp = y * 4.0;
	elseif (z <= 1.4e-6)
		tmp = x * -3.0;
	elseif (z <= 2e+184)
		tmp = t_0;
	else
		tmp = -6.0 * (y * z);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := Block[{t$95$0 = N[(6.0 * N[(x * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -5.1e+199], t$95$0, If[LessEqual[z, -0.22], N[(z * N[(y * -6.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -6.6e-298], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 5e-125], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 1.4e-6], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 2e+184], t$95$0, N[(-6.0 * N[(y * z), $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}

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

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

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

\mathbf{elif}\;z \leq 5 \cdot 10^{-125}:\\
\;\;\;\;y \cdot 4\\

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if z < -5.10000000000000005e199 or 1.39999999999999994e-6 < z < 2.00000000000000003e184

    1. Initial program 99.7%

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

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

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

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

        \[\leadsto \mathsf{fma}\left(y - x, 6 \cdot \color{blue}{\left(\frac{2}{3} + \left(-z\right)\right)}, x\right) \]
      5. distribute-rgt-in99.7%

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

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

        \[\leadsto \mathsf{fma}\left(y - x, \color{blue}{4} + \left(-z\right) \cdot 6, x\right) \]
      8. distribute-lft-neg-out99.7%

        \[\leadsto \mathsf{fma}\left(y - x, 4 + \color{blue}{\left(-z \cdot 6\right)}, x\right) \]
      9. distribute-rgt-neg-in99.7%

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

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

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

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

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

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

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

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

        \[\leadsto 1 \cdot x + -1 \cdot \left(\color{blue}{\mathsf{fma}\left(z, -6, 4\right)} \cdot x\right) \]
      6. associate-*r*59.8%

        \[\leadsto 1 \cdot x + \color{blue}{\left(-1 \cdot \mathsf{fma}\left(z, -6, 4\right)\right) \cdot x} \]
      7. neg-mul-159.8%

        \[\leadsto 1 \cdot x + \color{blue}{\left(-\mathsf{fma}\left(z, -6, 4\right)\right)} \cdot x \]
      8. fma-define59.8%

        \[\leadsto 1 \cdot x + \left(-\color{blue}{\left(z \cdot -6 + 4\right)}\right) \cdot x \]
      9. distribute-neg-in59.8%

        \[\leadsto 1 \cdot x + \color{blue}{\left(\left(-z \cdot -6\right) + \left(-4\right)\right)} \cdot x \]
      10. distribute-lft-neg-in59.8%

        \[\leadsto 1 \cdot x + \left(\color{blue}{\left(-z\right) \cdot -6} + \left(-4\right)\right) \cdot x \]
      11. metadata-eval59.8%

        \[\leadsto 1 \cdot x + \left(\left(-z\right) \cdot -6 + \color{blue}{-4}\right) \cdot x \]
      12. metadata-eval59.8%

        \[\leadsto 1 \cdot x + \left(\left(-z\right) \cdot -6 + \color{blue}{0.6666666666666666 \cdot -6}\right) \cdot x \]
      13. distribute-rgt-in59.8%

        \[\leadsto 1 \cdot x + \color{blue}{\left(-6 \cdot \left(\left(-z\right) + 0.6666666666666666\right)\right)} \cdot x \]
      14. +-commutative59.8%

        \[\leadsto 1 \cdot x + \left(-6 \cdot \color{blue}{\left(0.6666666666666666 + \left(-z\right)\right)}\right) \cdot x \]
      15. sub-neg59.8%

        \[\leadsto 1 \cdot x + \left(-6 \cdot \color{blue}{\left(0.6666666666666666 - z\right)}\right) \cdot x \]
      16. distribute-rgt-in59.8%

        \[\leadsto \color{blue}{x \cdot \left(1 + -6 \cdot \left(0.6666666666666666 - z\right)\right)} \]
      17. sub-neg59.8%

        \[\leadsto x \cdot \left(1 + -6 \cdot \color{blue}{\left(0.6666666666666666 + \left(-z\right)\right)}\right) \]
      18. distribute-rgt-in59.8%

        \[\leadsto x \cdot \left(1 + \color{blue}{\left(0.6666666666666666 \cdot -6 + \left(-z\right) \cdot -6\right)}\right) \]
      19. metadata-eval59.8%

        \[\leadsto x \cdot \left(1 + \left(\color{blue}{-4} + \left(-z\right) \cdot -6\right)\right) \]
      20. distribute-lft-neg-in59.8%

        \[\leadsto x \cdot \left(1 + \left(-4 + \color{blue}{\left(-z \cdot -6\right)}\right)\right) \]
      21. associate-+r+59.8%

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

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

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

        \[\leadsto x \cdot \left(z \cdot \left(6 - \color{blue}{\frac{3 \cdot 1}{z}}\right)\right) \]
      2. metadata-eval59.8%

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

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

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

    if -5.10000000000000005e199 < z < -0.220000000000000001

    1. Initial program 99.7%

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

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

      \[\leadsto \color{blue}{x + \left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right)} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. add-sqr-sqrt47.4%

        \[\leadsto \color{blue}{\sqrt{x} \cdot \sqrt{x}} + \left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right) \]
      2. fma-define47.4%

        \[\leadsto \color{blue}{\mathsf{fma}\left(\sqrt{x}, \sqrt{x}, \left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right)\right)} \]
      3. associate-*l*47.3%

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

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

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

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

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

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

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

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

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

    if -0.220000000000000001 < z < -6.6000000000000004e-298 or 4.99999999999999967e-125 < z < 1.39999999999999994e-6

    1. Initial program 99.2%

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

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

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

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

        \[\leadsto \mathsf{fma}\left(y - x, 6 \cdot \color{blue}{\left(\frac{2}{3} + \left(-z\right)\right)}, x\right) \]
      5. distribute-rgt-in99.7%

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

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

        \[\leadsto \mathsf{fma}\left(y - x, \color{blue}{4} + \left(-z\right) \cdot 6, x\right) \]
      8. distribute-lft-neg-out99.7%

        \[\leadsto \mathsf{fma}\left(y - x, 4 + \color{blue}{\left(-z \cdot 6\right)}, x\right) \]
      9. distribute-rgt-neg-in99.7%

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

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

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

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

        \[\leadsto \color{blue}{1 \cdot x} + -1 \cdot \left(x \cdot \left(4 + -6 \cdot z\right)\right) \]
      2. *-commutative57.6%

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

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

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

        \[\leadsto 1 \cdot x + -1 \cdot \left(\color{blue}{\mathsf{fma}\left(z, -6, 4\right)} \cdot x\right) \]
      6. associate-*r*57.6%

        \[\leadsto 1 \cdot x + \color{blue}{\left(-1 \cdot \mathsf{fma}\left(z, -6, 4\right)\right) \cdot x} \]
      7. neg-mul-157.6%

        \[\leadsto 1 \cdot x + \color{blue}{\left(-\mathsf{fma}\left(z, -6, 4\right)\right)} \cdot x \]
      8. fma-define57.6%

        \[\leadsto 1 \cdot x + \left(-\color{blue}{\left(z \cdot -6 + 4\right)}\right) \cdot x \]
      9. distribute-neg-in57.6%

        \[\leadsto 1 \cdot x + \color{blue}{\left(\left(-z \cdot -6\right) + \left(-4\right)\right)} \cdot x \]
      10. distribute-lft-neg-in57.6%

        \[\leadsto 1 \cdot x + \left(\color{blue}{\left(-z\right) \cdot -6} + \left(-4\right)\right) \cdot x \]
      11. metadata-eval57.6%

        \[\leadsto 1 \cdot x + \left(\left(-z\right) \cdot -6 + \color{blue}{-4}\right) \cdot x \]
      12. metadata-eval57.6%

        \[\leadsto 1 \cdot x + \left(\left(-z\right) \cdot -6 + \color{blue}{0.6666666666666666 \cdot -6}\right) \cdot x \]
      13. distribute-rgt-in57.5%

        \[\leadsto 1 \cdot x + \color{blue}{\left(-6 \cdot \left(\left(-z\right) + 0.6666666666666666\right)\right)} \cdot x \]
      14. +-commutative57.5%

        \[\leadsto 1 \cdot x + \left(-6 \cdot \color{blue}{\left(0.6666666666666666 + \left(-z\right)\right)}\right) \cdot x \]
      15. sub-neg57.5%

        \[\leadsto 1 \cdot x + \left(-6 \cdot \color{blue}{\left(0.6666666666666666 - z\right)}\right) \cdot x \]
      16. distribute-rgt-in57.5%

        \[\leadsto \color{blue}{x \cdot \left(1 + -6 \cdot \left(0.6666666666666666 - z\right)\right)} \]
      17. sub-neg57.5%

        \[\leadsto x \cdot \left(1 + -6 \cdot \color{blue}{\left(0.6666666666666666 + \left(-z\right)\right)}\right) \]
      18. distribute-rgt-in57.6%

        \[\leadsto x \cdot \left(1 + \color{blue}{\left(0.6666666666666666 \cdot -6 + \left(-z\right) \cdot -6\right)}\right) \]
      19. metadata-eval57.6%

        \[\leadsto x \cdot \left(1 + \left(\color{blue}{-4} + \left(-z\right) \cdot -6\right)\right) \]
      20. distribute-lft-neg-in57.6%

        \[\leadsto x \cdot \left(1 + \left(-4 + \color{blue}{\left(-z \cdot -6\right)}\right)\right) \]
      21. associate-+r+57.6%

        \[\leadsto x \cdot \color{blue}{\left(\left(1 + -4\right) + \left(-z \cdot -6\right)\right)} \]
    7. Simplified57.6%

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

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

        \[\leadsto \color{blue}{x \cdot -3} \]
    10. Simplified57.3%

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

    if -6.6000000000000004e-298 < z < 4.99999999999999967e-125

    1. Initial program 99.3%

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

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

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

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

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

    if 2.00000000000000003e184 < z

    1. Initial program 99.8%

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

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

      \[\leadsto \color{blue}{x + \left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right)} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. add-sqr-sqrt39.9%

        \[\leadsto \color{blue}{\sqrt{x} \cdot \sqrt{x}} + \left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right) \]
      2. fma-define39.9%

        \[\leadsto \color{blue}{\mathsf{fma}\left(\sqrt{x}, \sqrt{x}, \left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right)\right)} \]
      3. associate-*l*40.0%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -5.1 \cdot 10^{+199}:\\ \;\;\;\;6 \cdot \left(x \cdot z\right)\\ \mathbf{elif}\;z \leq -0.22:\\ \;\;\;\;z \cdot \left(y \cdot -6\right)\\ \mathbf{elif}\;z \leq -6.6 \cdot 10^{-298}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 5 \cdot 10^{-125}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 1.4 \cdot 10^{-6}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 2 \cdot 10^{+184}:\\ \;\;\;\;6 \cdot \left(x \cdot z\right)\\ \mathbf{else}:\\ \;\;\;\;-6 \cdot \left(y \cdot z\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 50.9% accurate, 0.4× 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.6 \cdot 10^{+192}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;z \leq -0.048:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq -2.4 \cdot 10^{-296}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 3.3 \cdot 10^{-125}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 1.4 \cdot 10^{-6}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 2.1 \cdot 10^{+183}:\\ \;\;\;\;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.6e+192)
     t_0
     (if (<= z -0.048)
       t_1
       (if (<= z -2.4e-296)
         (* x -3.0)
         (if (<= z 3.3e-125)
           (* y 4.0)
           (if (<= z 1.4e-6) (* x -3.0) (if (<= z 2.1e+183) 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.6e+192) {
		tmp = t_0;
	} else if (z <= -0.048) {
		tmp = t_1;
	} else if (z <= -2.4e-296) {
		tmp = x * -3.0;
	} else if (z <= 3.3e-125) {
		tmp = y * 4.0;
	} else if (z <= 1.4e-6) {
		tmp = x * -3.0;
	} else if (z <= 2.1e+183) {
		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.6d+192)) then
        tmp = t_0
    else if (z <= (-0.048d0)) then
        tmp = t_1
    else if (z <= (-2.4d-296)) then
        tmp = x * (-3.0d0)
    else if (z <= 3.3d-125) then
        tmp = y * 4.0d0
    else if (z <= 1.4d-6) then
        tmp = x * (-3.0d0)
    else if (z <= 2.1d+183) 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.6e+192) {
		tmp = t_0;
	} else if (z <= -0.048) {
		tmp = t_1;
	} else if (z <= -2.4e-296) {
		tmp = x * -3.0;
	} else if (z <= 3.3e-125) {
		tmp = y * 4.0;
	} else if (z <= 1.4e-6) {
		tmp = x * -3.0;
	} else if (z <= 2.1e+183) {
		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.6e+192:
		tmp = t_0
	elif z <= -0.048:
		tmp = t_1
	elif z <= -2.4e-296:
		tmp = x * -3.0
	elif z <= 3.3e-125:
		tmp = y * 4.0
	elif z <= 1.4e-6:
		tmp = x * -3.0
	elif z <= 2.1e+183:
		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.6e+192)
		tmp = t_0;
	elseif (z <= -0.048)
		tmp = t_1;
	elseif (z <= -2.4e-296)
		tmp = Float64(x * -3.0);
	elseif (z <= 3.3e-125)
		tmp = Float64(y * 4.0);
	elseif (z <= 1.4e-6)
		tmp = Float64(x * -3.0);
	elseif (z <= 2.1e+183)
		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.6e+192)
		tmp = t_0;
	elseif (z <= -0.048)
		tmp = t_1;
	elseif (z <= -2.4e-296)
		tmp = x * -3.0;
	elseif (z <= 3.3e-125)
		tmp = y * 4.0;
	elseif (z <= 1.4e-6)
		tmp = x * -3.0;
	elseif (z <= 2.1e+183)
		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.6e+192], t$95$0, If[LessEqual[z, -0.048], t$95$1, If[LessEqual[z, -2.4e-296], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 3.3e-125], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 1.4e-6], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 2.1e+183], 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.6 \cdot 10^{+192}:\\
\;\;\;\;t\_0\\

\mathbf{elif}\;z \leq -0.048:\\
\;\;\;\;t\_1\\

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

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

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

\mathbf{elif}\;z \leq 2.1 \cdot 10^{+183}:\\
\;\;\;\;t\_0\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -4.5999999999999999e192 or 1.39999999999999994e-6 < z < 2.1e183

    1. Initial program 99.7%

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

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

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

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

        \[\leadsto \mathsf{fma}\left(y - x, 6 \cdot \color{blue}{\left(\frac{2}{3} + \left(-z\right)\right)}, x\right) \]
      5. distribute-rgt-in99.7%

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

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

        \[\leadsto \mathsf{fma}\left(y - x, \color{blue}{4} + \left(-z\right) \cdot 6, x\right) \]
      8. distribute-lft-neg-out99.7%

        \[\leadsto \mathsf{fma}\left(y - x, 4 + \color{blue}{\left(-z \cdot 6\right)}, x\right) \]
      9. distribute-rgt-neg-in99.7%

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

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

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

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

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

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

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

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

        \[\leadsto 1 \cdot x + -1 \cdot \left(\color{blue}{\mathsf{fma}\left(z, -6, 4\right)} \cdot x\right) \]
      6. associate-*r*59.8%

        \[\leadsto 1 \cdot x + \color{blue}{\left(-1 \cdot \mathsf{fma}\left(z, -6, 4\right)\right) \cdot x} \]
      7. neg-mul-159.8%

        \[\leadsto 1 \cdot x + \color{blue}{\left(-\mathsf{fma}\left(z, -6, 4\right)\right)} \cdot x \]
      8. fma-define59.8%

        \[\leadsto 1 \cdot x + \left(-\color{blue}{\left(z \cdot -6 + 4\right)}\right) \cdot x \]
      9. distribute-neg-in59.8%

        \[\leadsto 1 \cdot x + \color{blue}{\left(\left(-z \cdot -6\right) + \left(-4\right)\right)} \cdot x \]
      10. distribute-lft-neg-in59.8%

        \[\leadsto 1 \cdot x + \left(\color{blue}{\left(-z\right) \cdot -6} + \left(-4\right)\right) \cdot x \]
      11. metadata-eval59.8%

        \[\leadsto 1 \cdot x + \left(\left(-z\right) \cdot -6 + \color{blue}{-4}\right) \cdot x \]
      12. metadata-eval59.8%

        \[\leadsto 1 \cdot x + \left(\left(-z\right) \cdot -6 + \color{blue}{0.6666666666666666 \cdot -6}\right) \cdot x \]
      13. distribute-rgt-in59.8%

        \[\leadsto 1 \cdot x + \color{blue}{\left(-6 \cdot \left(\left(-z\right) + 0.6666666666666666\right)\right)} \cdot x \]
      14. +-commutative59.8%

        \[\leadsto 1 \cdot x + \left(-6 \cdot \color{blue}{\left(0.6666666666666666 + \left(-z\right)\right)}\right) \cdot x \]
      15. sub-neg59.8%

        \[\leadsto 1 \cdot x + \left(-6 \cdot \color{blue}{\left(0.6666666666666666 - z\right)}\right) \cdot x \]
      16. distribute-rgt-in59.8%

        \[\leadsto \color{blue}{x \cdot \left(1 + -6 \cdot \left(0.6666666666666666 - z\right)\right)} \]
      17. sub-neg59.8%

        \[\leadsto x \cdot \left(1 + -6 \cdot \color{blue}{\left(0.6666666666666666 + \left(-z\right)\right)}\right) \]
      18. distribute-rgt-in59.8%

        \[\leadsto x \cdot \left(1 + \color{blue}{\left(0.6666666666666666 \cdot -6 + \left(-z\right) \cdot -6\right)}\right) \]
      19. metadata-eval59.8%

        \[\leadsto x \cdot \left(1 + \left(\color{blue}{-4} + \left(-z\right) \cdot -6\right)\right) \]
      20. distribute-lft-neg-in59.8%

        \[\leadsto x \cdot \left(1 + \left(-4 + \color{blue}{\left(-z \cdot -6\right)}\right)\right) \]
      21. associate-+r+59.8%

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

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

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

        \[\leadsto x \cdot \left(z \cdot \left(6 - \color{blue}{\frac{3 \cdot 1}{z}}\right)\right) \]
      2. metadata-eval59.8%

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

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

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

    if -4.5999999999999999e192 < z < -0.048000000000000001 or 2.1e183 < z

    1. Initial program 99.8%

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

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

      \[\leadsto \color{blue}{x + \left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right)} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. add-sqr-sqrt44.5%

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(\sqrt{x}, \sqrt{x}, \left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right)\right)} \]
      3. associate-*l*44.5%

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

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

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

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

    if -0.048000000000000001 < z < -2.39999999999999996e-296 or 3.3000000000000001e-125 < z < 1.39999999999999994e-6

    1. Initial program 99.2%

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

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

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

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

        \[\leadsto \mathsf{fma}\left(y - x, 6 \cdot \color{blue}{\left(\frac{2}{3} + \left(-z\right)\right)}, x\right) \]
      5. distribute-rgt-in99.7%

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

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

        \[\leadsto \mathsf{fma}\left(y - x, \color{blue}{4} + \left(-z\right) \cdot 6, x\right) \]
      8. distribute-lft-neg-out99.7%

        \[\leadsto \mathsf{fma}\left(y - x, 4 + \color{blue}{\left(-z \cdot 6\right)}, x\right) \]
      9. distribute-rgt-neg-in99.7%

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

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

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

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

        \[\leadsto \color{blue}{1 \cdot x} + -1 \cdot \left(x \cdot \left(4 + -6 \cdot z\right)\right) \]
      2. *-commutative57.6%

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

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

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

        \[\leadsto 1 \cdot x + -1 \cdot \left(\color{blue}{\mathsf{fma}\left(z, -6, 4\right)} \cdot x\right) \]
      6. associate-*r*57.6%

        \[\leadsto 1 \cdot x + \color{blue}{\left(-1 \cdot \mathsf{fma}\left(z, -6, 4\right)\right) \cdot x} \]
      7. neg-mul-157.6%

        \[\leadsto 1 \cdot x + \color{blue}{\left(-\mathsf{fma}\left(z, -6, 4\right)\right)} \cdot x \]
      8. fma-define57.6%

        \[\leadsto 1 \cdot x + \left(-\color{blue}{\left(z \cdot -6 + 4\right)}\right) \cdot x \]
      9. distribute-neg-in57.6%

        \[\leadsto 1 \cdot x + \color{blue}{\left(\left(-z \cdot -6\right) + \left(-4\right)\right)} \cdot x \]
      10. distribute-lft-neg-in57.6%

        \[\leadsto 1 \cdot x + \left(\color{blue}{\left(-z\right) \cdot -6} + \left(-4\right)\right) \cdot x \]
      11. metadata-eval57.6%

        \[\leadsto 1 \cdot x + \left(\left(-z\right) \cdot -6 + \color{blue}{-4}\right) \cdot x \]
      12. metadata-eval57.6%

        \[\leadsto 1 \cdot x + \left(\left(-z\right) \cdot -6 + \color{blue}{0.6666666666666666 \cdot -6}\right) \cdot x \]
      13. distribute-rgt-in57.5%

        \[\leadsto 1 \cdot x + \color{blue}{\left(-6 \cdot \left(\left(-z\right) + 0.6666666666666666\right)\right)} \cdot x \]
      14. +-commutative57.5%

        \[\leadsto 1 \cdot x + \left(-6 \cdot \color{blue}{\left(0.6666666666666666 + \left(-z\right)\right)}\right) \cdot x \]
      15. sub-neg57.5%

        \[\leadsto 1 \cdot x + \left(-6 \cdot \color{blue}{\left(0.6666666666666666 - z\right)}\right) \cdot x \]
      16. distribute-rgt-in57.5%

        \[\leadsto \color{blue}{x \cdot \left(1 + -6 \cdot \left(0.6666666666666666 - z\right)\right)} \]
      17. sub-neg57.5%

        \[\leadsto x \cdot \left(1 + -6 \cdot \color{blue}{\left(0.6666666666666666 + \left(-z\right)\right)}\right) \]
      18. distribute-rgt-in57.6%

        \[\leadsto x \cdot \left(1 + \color{blue}{\left(0.6666666666666666 \cdot -6 + \left(-z\right) \cdot -6\right)}\right) \]
      19. metadata-eval57.6%

        \[\leadsto x \cdot \left(1 + \left(\color{blue}{-4} + \left(-z\right) \cdot -6\right)\right) \]
      20. distribute-lft-neg-in57.6%

        \[\leadsto x \cdot \left(1 + \left(-4 + \color{blue}{\left(-z \cdot -6\right)}\right)\right) \]
      21. associate-+r+57.6%

        \[\leadsto x \cdot \color{blue}{\left(\left(1 + -4\right) + \left(-z \cdot -6\right)\right)} \]
    7. Simplified57.6%

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

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

        \[\leadsto \color{blue}{x \cdot -3} \]
    10. Simplified57.3%

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

    if -2.39999999999999996e-296 < z < 3.3000000000000001e-125

    1. Initial program 99.3%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -4.6 \cdot 10^{+192}:\\ \;\;\;\;6 \cdot \left(x \cdot z\right)\\ \mathbf{elif}\;z \leq -0.048:\\ \;\;\;\;-6 \cdot \left(y \cdot z\right)\\ \mathbf{elif}\;z \leq -2.4 \cdot 10^{-296}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 3.3 \cdot 10^{-125}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 1.4 \cdot 10^{-6}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 2.1 \cdot 10^{+183}:\\ \;\;\;\;6 \cdot \left(x \cdot z\right)\\ \mathbf{else}:\\ \;\;\;\;-6 \cdot \left(y \cdot z\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 75.7% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := x \cdot \left(-3 + z \cdot 6\right)\\ t_1 := -6 \cdot \left(\left(y - x\right) \cdot z\right)\\ \mathbf{if}\;z \leq -82000000:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq -1.9 \cdot 10^{-295}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;z \leq 2.05 \cdot 10^{-125}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 15600:\\ \;\;\;\;t\_0\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (let* ((t_0 (* x (+ -3.0 (* z 6.0)))) (t_1 (* -6.0 (* (- y x) z))))
   (if (<= z -82000000.0)
     t_1
     (if (<= z -1.9e-295)
       t_0
       (if (<= z 2.05e-125) (* y 4.0) (if (<= z 15600.0) t_0 t_1))))))
double code(double x, double y, double z) {
	double t_0 = x * (-3.0 + (z * 6.0));
	double t_1 = -6.0 * ((y - x) * z);
	double tmp;
	if (z <= -82000000.0) {
		tmp = t_1;
	} else if (z <= -1.9e-295) {
		tmp = t_0;
	} else if (z <= 2.05e-125) {
		tmp = y * 4.0;
	} else if (z <= 15600.0) {
		tmp = t_0;
	} else {
		tmp = t_1;
	}
	return tmp;
}
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8) :: t_0
    real(8) :: t_1
    real(8) :: tmp
    t_0 = x * ((-3.0d0) + (z * 6.0d0))
    t_1 = (-6.0d0) * ((y - x) * z)
    if (z <= (-82000000.0d0)) then
        tmp = t_1
    else if (z <= (-1.9d-295)) then
        tmp = t_0
    else if (z <= 2.05d-125) then
        tmp = y * 4.0d0
    else if (z <= 15600.0d0) then
        tmp = t_0
    else
        tmp = t_1
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double t_0 = x * (-3.0 + (z * 6.0));
	double t_1 = -6.0 * ((y - x) * z);
	double tmp;
	if (z <= -82000000.0) {
		tmp = t_1;
	} else if (z <= -1.9e-295) {
		tmp = t_0;
	} else if (z <= 2.05e-125) {
		tmp = y * 4.0;
	} else if (z <= 15600.0) {
		tmp = t_0;
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z):
	t_0 = x * (-3.0 + (z * 6.0))
	t_1 = -6.0 * ((y - x) * z)
	tmp = 0
	if z <= -82000000.0:
		tmp = t_1
	elif z <= -1.9e-295:
		tmp = t_0
	elif z <= 2.05e-125:
		tmp = y * 4.0
	elif z <= 15600.0:
		tmp = t_0
	else:
		tmp = t_1
	return tmp
function code(x, y, z)
	t_0 = Float64(x * Float64(-3.0 + Float64(z * 6.0)))
	t_1 = Float64(-6.0 * Float64(Float64(y - x) * z))
	tmp = 0.0
	if (z <= -82000000.0)
		tmp = t_1;
	elseif (z <= -1.9e-295)
		tmp = t_0;
	elseif (z <= 2.05e-125)
		tmp = Float64(y * 4.0);
	elseif (z <= 15600.0)
		tmp = t_0;
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	t_0 = x * (-3.0 + (z * 6.0));
	t_1 = -6.0 * ((y - x) * z);
	tmp = 0.0;
	if (z <= -82000000.0)
		tmp = t_1;
	elseif (z <= -1.9e-295)
		tmp = t_0;
	elseif (z <= 2.05e-125)
		tmp = y * 4.0;
	elseif (z <= 15600.0)
		tmp = t_0;
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := Block[{t$95$0 = N[(x * N[(-3.0 + N[(z * 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(-6.0 * N[(N[(y - x), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -82000000.0], t$95$1, If[LessEqual[z, -1.9e-295], t$95$0, If[LessEqual[z, 2.05e-125], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 15600.0], t$95$0, t$95$1]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;z \leq -1.9 \cdot 10^{-295}:\\
\;\;\;\;t\_0\\

\mathbf{elif}\;z \leq 2.05 \cdot 10^{-125}:\\
\;\;\;\;y \cdot 4\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -8.2e7 or 15600 < z

    1. Initial program 99.7%

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

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

      \[\leadsto \color{blue}{x + \left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right)} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. add-sqr-sqrt52.6%

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(\sqrt{x}, \sqrt{x}, \left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right)\right)} \]
      3. associate-*l*52.5%

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

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

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

    if -8.2e7 < z < -1.90000000000000009e-295 or 2.0499999999999999e-125 < z < 15600

    1. Initial program 99.2%

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

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

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

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

        \[\leadsto \mathsf{fma}\left(y - x, 6 \cdot \color{blue}{\left(\frac{2}{3} + \left(-z\right)\right)}, x\right) \]
      5. distribute-rgt-in99.7%

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

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

        \[\leadsto \mathsf{fma}\left(y - x, \color{blue}{4} + \left(-z\right) \cdot 6, x\right) \]
      8. distribute-lft-neg-out99.7%

        \[\leadsto \mathsf{fma}\left(y - x, 4 + \color{blue}{\left(-z \cdot 6\right)}, x\right) \]
      9. distribute-rgt-neg-in99.7%

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

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

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

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

        \[\leadsto \color{blue}{1 \cdot x} + -1 \cdot \left(x \cdot \left(4 + -6 \cdot z\right)\right) \]
      2. *-commutative57.2%

        \[\leadsto 1 \cdot x + -1 \cdot \color{blue}{\left(\left(4 + -6 \cdot z\right) \cdot x\right)} \]
      3. +-commutative57.2%

        \[\leadsto 1 \cdot x + -1 \cdot \left(\color{blue}{\left(-6 \cdot z + 4\right)} \cdot x\right) \]
      4. *-commutative57.2%

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

        \[\leadsto 1 \cdot x + -1 \cdot \left(\color{blue}{\mathsf{fma}\left(z, -6, 4\right)} \cdot x\right) \]
      6. associate-*r*57.2%

        \[\leadsto 1 \cdot x + \color{blue}{\left(-1 \cdot \mathsf{fma}\left(z, -6, 4\right)\right) \cdot x} \]
      7. neg-mul-157.2%

        \[\leadsto 1 \cdot x + \color{blue}{\left(-\mathsf{fma}\left(z, -6, 4\right)\right)} \cdot x \]
      8. fma-define57.2%

        \[\leadsto 1 \cdot x + \left(-\color{blue}{\left(z \cdot -6 + 4\right)}\right) \cdot x \]
      9. distribute-neg-in57.2%

        \[\leadsto 1 \cdot x + \color{blue}{\left(\left(-z \cdot -6\right) + \left(-4\right)\right)} \cdot x \]
      10. distribute-lft-neg-in57.2%

        \[\leadsto 1 \cdot x + \left(\color{blue}{\left(-z\right) \cdot -6} + \left(-4\right)\right) \cdot x \]
      11. metadata-eval57.2%

        \[\leadsto 1 \cdot x + \left(\left(-z\right) \cdot -6 + \color{blue}{-4}\right) \cdot x \]
      12. metadata-eval57.2%

        \[\leadsto 1 \cdot x + \left(\left(-z\right) \cdot -6 + \color{blue}{0.6666666666666666 \cdot -6}\right) \cdot x \]
      13. distribute-rgt-in57.2%

        \[\leadsto 1 \cdot x + \color{blue}{\left(-6 \cdot \left(\left(-z\right) + 0.6666666666666666\right)\right)} \cdot x \]
      14. +-commutative57.2%

        \[\leadsto 1 \cdot x + \left(-6 \cdot \color{blue}{\left(0.6666666666666666 + \left(-z\right)\right)}\right) \cdot x \]
      15. sub-neg57.2%

        \[\leadsto 1 \cdot x + \left(-6 \cdot \color{blue}{\left(0.6666666666666666 - z\right)}\right) \cdot x \]
      16. distribute-rgt-in57.2%

        \[\leadsto \color{blue}{x \cdot \left(1 + -6 \cdot \left(0.6666666666666666 - z\right)\right)} \]
      17. sub-neg57.2%

        \[\leadsto x \cdot \left(1 + -6 \cdot \color{blue}{\left(0.6666666666666666 + \left(-z\right)\right)}\right) \]
      18. distribute-rgt-in57.2%

        \[\leadsto x \cdot \left(1 + \color{blue}{\left(0.6666666666666666 \cdot -6 + \left(-z\right) \cdot -6\right)}\right) \]
      19. metadata-eval57.2%

        \[\leadsto x \cdot \left(1 + \left(\color{blue}{-4} + \left(-z\right) \cdot -6\right)\right) \]
      20. distribute-lft-neg-in57.2%

        \[\leadsto x \cdot \left(1 + \left(-4 + \color{blue}{\left(-z \cdot -6\right)}\right)\right) \]
      21. associate-+r+57.2%

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

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

    if -1.90000000000000009e-295 < z < 2.0499999999999999e-125

    1. Initial program 99.3%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -82000000:\\ \;\;\;\;-6 \cdot \left(\left(y - x\right) \cdot z\right)\\ \mathbf{elif}\;z \leq -1.9 \cdot 10^{-295}:\\ \;\;\;\;x \cdot \left(-3 + z \cdot 6\right)\\ \mathbf{elif}\;z \leq 2.05 \cdot 10^{-125}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 15600:\\ \;\;\;\;x \cdot \left(-3 + z \cdot 6\right)\\ \mathbf{else}:\\ \;\;\;\;-6 \cdot \left(\left(y - x\right) \cdot z\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 75.1% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := -6 \cdot \left(\left(y - x\right) \cdot z\right)\\ \mathbf{if}\;z \leq -0.011:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;z \leq -7.8 \cdot 10^{-299}:\\ \;\;\;\;x \cdot \left(z \cdot \frac{-3}{z}\right)\\ \mathbf{elif}\;z \leq 4.1 \cdot 10^{-125}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 0.5:\\ \;\;\;\;x \cdot -3\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (let* ((t_0 (* -6.0 (* (- y x) z))))
   (if (<= z -0.011)
     t_0
     (if (<= z -7.8e-299)
       (* x (* z (/ -3.0 z)))
       (if (<= z 4.1e-125) (* y 4.0) (if (<= z 0.5) (* x -3.0) t_0))))))
double code(double x, double y, double z) {
	double t_0 = -6.0 * ((y - x) * z);
	double tmp;
	if (z <= -0.011) {
		tmp = t_0;
	} else if (z <= -7.8e-299) {
		tmp = x * (z * (-3.0 / z));
	} else if (z <= 4.1e-125) {
		tmp = y * 4.0;
	} else if (z <= 0.5) {
		tmp = x * -3.0;
	} else {
		tmp = t_0;
	}
	return tmp;
}
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8) :: t_0
    real(8) :: tmp
    t_0 = (-6.0d0) * ((y - x) * z)
    if (z <= (-0.011d0)) then
        tmp = t_0
    else if (z <= (-7.8d-299)) then
        tmp = x * (z * ((-3.0d0) / z))
    else if (z <= 4.1d-125) then
        tmp = y * 4.0d0
    else if (z <= 0.5d0) then
        tmp = x * (-3.0d0)
    else
        tmp = t_0
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double t_0 = -6.0 * ((y - x) * z);
	double tmp;
	if (z <= -0.011) {
		tmp = t_0;
	} else if (z <= -7.8e-299) {
		tmp = x * (z * (-3.0 / z));
	} else if (z <= 4.1e-125) {
		tmp = y * 4.0;
	} else if (z <= 0.5) {
		tmp = x * -3.0;
	} else {
		tmp = t_0;
	}
	return tmp;
}
def code(x, y, z):
	t_0 = -6.0 * ((y - x) * z)
	tmp = 0
	if z <= -0.011:
		tmp = t_0
	elif z <= -7.8e-299:
		tmp = x * (z * (-3.0 / z))
	elif z <= 4.1e-125:
		tmp = y * 4.0
	elif z <= 0.5:
		tmp = x * -3.0
	else:
		tmp = t_0
	return tmp
function code(x, y, z)
	t_0 = Float64(-6.0 * Float64(Float64(y - x) * z))
	tmp = 0.0
	if (z <= -0.011)
		tmp = t_0;
	elseif (z <= -7.8e-299)
		tmp = Float64(x * Float64(z * Float64(-3.0 / z)));
	elseif (z <= 4.1e-125)
		tmp = Float64(y * 4.0);
	elseif (z <= 0.5)
		tmp = Float64(x * -3.0);
	else
		tmp = t_0;
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	t_0 = -6.0 * ((y - x) * z);
	tmp = 0.0;
	if (z <= -0.011)
		tmp = t_0;
	elseif (z <= -7.8e-299)
		tmp = x * (z * (-3.0 / z));
	elseif (z <= 4.1e-125)
		tmp = y * 4.0;
	elseif (z <= 0.5)
		tmp = x * -3.0;
	else
		tmp = t_0;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := Block[{t$95$0 = N[(-6.0 * N[(N[(y - x), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -0.011], t$95$0, If[LessEqual[z, -7.8e-299], N[(x * N[(z * N[(-3.0 / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 4.1e-125], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 0.5], N[(x * -3.0), $MachinePrecision], t$95$0]]]]]
\begin{array}{l}

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

\mathbf{elif}\;z \leq -7.8 \cdot 10^{-299}:\\
\;\;\;\;x \cdot \left(z \cdot \frac{-3}{z}\right)\\

\mathbf{elif}\;z \leq 4.1 \cdot 10^{-125}:\\
\;\;\;\;y \cdot 4\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -0.010999999999999999 or 0.5 < z

    1. Initial program 99.7%

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

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

      \[\leadsto \color{blue}{x + \left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right)} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. add-sqr-sqrt52.9%

        \[\leadsto \color{blue}{\sqrt{x} \cdot \sqrt{x}} + \left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right) \]
      2. fma-define52.9%

        \[\leadsto \color{blue}{\mathsf{fma}\left(\sqrt{x}, \sqrt{x}, \left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right)\right)} \]
      3. associate-*l*52.9%

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

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

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

    if -0.010999999999999999 < z < -7.7999999999999997e-299

    1. Initial program 99.1%

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

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

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

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

        \[\leadsto \mathsf{fma}\left(y - x, 6 \cdot \color{blue}{\left(\frac{2}{3} + \left(-z\right)\right)}, x\right) \]
      5. distribute-rgt-in99.7%

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

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

        \[\leadsto \mathsf{fma}\left(y - x, \color{blue}{4} + \left(-z\right) \cdot 6, x\right) \]
      8. distribute-lft-neg-out99.7%

        \[\leadsto \mathsf{fma}\left(y - x, 4 + \color{blue}{\left(-z \cdot 6\right)}, x\right) \]
      9. distribute-rgt-neg-in99.7%

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

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

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

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

        \[\leadsto \color{blue}{1 \cdot x} + -1 \cdot \left(x \cdot \left(4 + -6 \cdot z\right)\right) \]
      2. *-commutative53.9%

        \[\leadsto 1 \cdot x + -1 \cdot \color{blue}{\left(\left(4 + -6 \cdot z\right) \cdot x\right)} \]
      3. +-commutative53.9%

        \[\leadsto 1 \cdot x + -1 \cdot \left(\color{blue}{\left(-6 \cdot z + 4\right)} \cdot x\right) \]
      4. *-commutative53.9%

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

        \[\leadsto 1 \cdot x + -1 \cdot \left(\color{blue}{\mathsf{fma}\left(z, -6, 4\right)} \cdot x\right) \]
      6. associate-*r*53.9%

        \[\leadsto 1 \cdot x + \color{blue}{\left(-1 \cdot \mathsf{fma}\left(z, -6, 4\right)\right) \cdot x} \]
      7. neg-mul-153.9%

        \[\leadsto 1 \cdot x + \color{blue}{\left(-\mathsf{fma}\left(z, -6, 4\right)\right)} \cdot x \]
      8. fma-define53.9%

        \[\leadsto 1 \cdot x + \left(-\color{blue}{\left(z \cdot -6 + 4\right)}\right) \cdot x \]
      9. distribute-neg-in53.9%

        \[\leadsto 1 \cdot x + \color{blue}{\left(\left(-z \cdot -6\right) + \left(-4\right)\right)} \cdot x \]
      10. distribute-lft-neg-in53.9%

        \[\leadsto 1 \cdot x + \left(\color{blue}{\left(-z\right) \cdot -6} + \left(-4\right)\right) \cdot x \]
      11. metadata-eval53.9%

        \[\leadsto 1 \cdot x + \left(\left(-z\right) \cdot -6 + \color{blue}{-4}\right) \cdot x \]
      12. metadata-eval53.9%

        \[\leadsto 1 \cdot x + \left(\left(-z\right) \cdot -6 + \color{blue}{0.6666666666666666 \cdot -6}\right) \cdot x \]
      13. distribute-rgt-in53.9%

        \[\leadsto 1 \cdot x + \color{blue}{\left(-6 \cdot \left(\left(-z\right) + 0.6666666666666666\right)\right)} \cdot x \]
      14. +-commutative53.9%

        \[\leadsto 1 \cdot x + \left(-6 \cdot \color{blue}{\left(0.6666666666666666 + \left(-z\right)\right)}\right) \cdot x \]
      15. sub-neg53.9%

        \[\leadsto 1 \cdot x + \left(-6 \cdot \color{blue}{\left(0.6666666666666666 - z\right)}\right) \cdot x \]
      16. distribute-rgt-in53.9%

        \[\leadsto \color{blue}{x \cdot \left(1 + -6 \cdot \left(0.6666666666666666 - z\right)\right)} \]
      17. sub-neg53.9%

        \[\leadsto x \cdot \left(1 + -6 \cdot \color{blue}{\left(0.6666666666666666 + \left(-z\right)\right)}\right) \]
      18. distribute-rgt-in53.9%

        \[\leadsto x \cdot \left(1 + \color{blue}{\left(0.6666666666666666 \cdot -6 + \left(-z\right) \cdot -6\right)}\right) \]
      19. metadata-eval53.9%

        \[\leadsto x \cdot \left(1 + \left(\color{blue}{-4} + \left(-z\right) \cdot -6\right)\right) \]
      20. distribute-lft-neg-in53.9%

        \[\leadsto x \cdot \left(1 + \left(-4 + \color{blue}{\left(-z \cdot -6\right)}\right)\right) \]
      21. associate-+r+53.9%

        \[\leadsto x \cdot \color{blue}{\left(\left(1 + -4\right) + \left(-z \cdot -6\right)\right)} \]
    7. Simplified53.9%

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

      \[\leadsto x \cdot \color{blue}{\left(z \cdot \left(6 - 3 \cdot \frac{1}{z}\right)\right)} \]
    9. Step-by-step derivation
      1. associate-*r/53.9%

        \[\leadsto x \cdot \left(z \cdot \left(6 - \color{blue}{\frac{3 \cdot 1}{z}}\right)\right) \]
      2. metadata-eval53.9%

        \[\leadsto x \cdot \left(z \cdot \left(6 - \frac{\color{blue}{3}}{z}\right)\right) \]
    10. Simplified53.9%

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

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

    if -7.7999999999999997e-299 < z < 4.0999999999999997e-125

    1. Initial program 99.3%

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

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

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

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

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

    if 4.0999999999999997e-125 < z < 0.5

    1. Initial program 99.2%

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

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

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

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

        \[\leadsto \mathsf{fma}\left(y - x, 6 \cdot \color{blue}{\left(\frac{2}{3} + \left(-z\right)\right)}, x\right) \]
      5. distribute-rgt-in99.8%

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

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

        \[\leadsto \mathsf{fma}\left(y - x, \color{blue}{4} + \left(-z\right) \cdot 6, x\right) \]
      8. distribute-lft-neg-out99.8%

        \[\leadsto \mathsf{fma}\left(y - x, 4 + \color{blue}{\left(-z \cdot 6\right)}, x\right) \]
      9. distribute-rgt-neg-in99.8%

        \[\leadsto \mathsf{fma}\left(y - x, 4 + \color{blue}{z \cdot \left(-6\right)}, x\right) \]
      10. metadata-eval99.8%

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

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

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

        \[\leadsto \color{blue}{1 \cdot x} + -1 \cdot \left(x \cdot \left(4 + -6 \cdot z\right)\right) \]
      2. *-commutative62.1%

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

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

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

        \[\leadsto 1 \cdot x + -1 \cdot \left(\color{blue}{\mathsf{fma}\left(z, -6, 4\right)} \cdot x\right) \]
      6. associate-*r*62.1%

        \[\leadsto 1 \cdot x + \color{blue}{\left(-1 \cdot \mathsf{fma}\left(z, -6, 4\right)\right) \cdot x} \]
      7. neg-mul-162.1%

        \[\leadsto 1 \cdot x + \color{blue}{\left(-\mathsf{fma}\left(z, -6, 4\right)\right)} \cdot x \]
      8. fma-define62.1%

        \[\leadsto 1 \cdot x + \left(-\color{blue}{\left(z \cdot -6 + 4\right)}\right) \cdot x \]
      9. distribute-neg-in62.1%

        \[\leadsto 1 \cdot x + \color{blue}{\left(\left(-z \cdot -6\right) + \left(-4\right)\right)} \cdot x \]
      10. distribute-lft-neg-in62.1%

        \[\leadsto 1 \cdot x + \left(\color{blue}{\left(-z\right) \cdot -6} + \left(-4\right)\right) \cdot x \]
      11. metadata-eval62.1%

        \[\leadsto 1 \cdot x + \left(\left(-z\right) \cdot -6 + \color{blue}{-4}\right) \cdot x \]
      12. metadata-eval62.1%

        \[\leadsto 1 \cdot x + \left(\left(-z\right) \cdot -6 + \color{blue}{0.6666666666666666 \cdot -6}\right) \cdot x \]
      13. distribute-rgt-in62.0%

        \[\leadsto 1 \cdot x + \color{blue}{\left(-6 \cdot \left(\left(-z\right) + 0.6666666666666666\right)\right)} \cdot x \]
      14. +-commutative62.0%

        \[\leadsto 1 \cdot x + \left(-6 \cdot \color{blue}{\left(0.6666666666666666 + \left(-z\right)\right)}\right) \cdot x \]
      15. sub-neg62.0%

        \[\leadsto 1 \cdot x + \left(-6 \cdot \color{blue}{\left(0.6666666666666666 - z\right)}\right) \cdot x \]
      16. distribute-rgt-in62.0%

        \[\leadsto \color{blue}{x \cdot \left(1 + -6 \cdot \left(0.6666666666666666 - z\right)\right)} \]
      17. sub-neg62.0%

        \[\leadsto x \cdot \left(1 + -6 \cdot \color{blue}{\left(0.6666666666666666 + \left(-z\right)\right)}\right) \]
      18. distribute-rgt-in62.1%

        \[\leadsto x \cdot \left(1 + \color{blue}{\left(0.6666666666666666 \cdot -6 + \left(-z\right) \cdot -6\right)}\right) \]
      19. metadata-eval62.1%

        \[\leadsto x \cdot \left(1 + \left(\color{blue}{-4} + \left(-z\right) \cdot -6\right)\right) \]
      20. distribute-lft-neg-in62.1%

        \[\leadsto x \cdot \left(1 + \left(-4 + \color{blue}{\left(-z \cdot -6\right)}\right)\right) \]
      21. associate-+r+62.1%

        \[\leadsto x \cdot \color{blue}{\left(\left(1 + -4\right) + \left(-z \cdot -6\right)\right)} \]
    7. Simplified62.1%

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

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

        \[\leadsto \color{blue}{x \cdot -3} \]
    10. Simplified61.3%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -0.011:\\ \;\;\;\;-6 \cdot \left(\left(y - x\right) \cdot z\right)\\ \mathbf{elif}\;z \leq -7.8 \cdot 10^{-299}:\\ \;\;\;\;x \cdot \left(z \cdot \frac{-3}{z}\right)\\ \mathbf{elif}\;z \leq 4.1 \cdot 10^{-125}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 0.5:\\ \;\;\;\;x \cdot -3\\ \mathbf{else}:\\ \;\;\;\;-6 \cdot \left(\left(y - x\right) \cdot z\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 8: 75.1% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := -6 \cdot \left(\left(y - x\right) \cdot z\right)\\ \mathbf{if}\;z \leq -0.018:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;z \leq -3.8 \cdot 10^{-294}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 6.2 \cdot 10^{-125}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 0.5:\\ \;\;\;\;x \cdot -3\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (let* ((t_0 (* -6.0 (* (- y x) z))))
   (if (<= z -0.018)
     t_0
     (if (<= z -3.8e-294)
       (* x -3.0)
       (if (<= z 6.2e-125) (* y 4.0) (if (<= z 0.5) (* x -3.0) t_0))))))
double code(double x, double y, double z) {
	double t_0 = -6.0 * ((y - x) * z);
	double tmp;
	if (z <= -0.018) {
		tmp = t_0;
	} else if (z <= -3.8e-294) {
		tmp = x * -3.0;
	} else if (z <= 6.2e-125) {
		tmp = y * 4.0;
	} else if (z <= 0.5) {
		tmp = x * -3.0;
	} else {
		tmp = t_0;
	}
	return tmp;
}
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8) :: t_0
    real(8) :: tmp
    t_0 = (-6.0d0) * ((y - x) * z)
    if (z <= (-0.018d0)) then
        tmp = t_0
    else if (z <= (-3.8d-294)) then
        tmp = x * (-3.0d0)
    else if (z <= 6.2d-125) then
        tmp = y * 4.0d0
    else if (z <= 0.5d0) then
        tmp = x * (-3.0d0)
    else
        tmp = t_0
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double t_0 = -6.0 * ((y - x) * z);
	double tmp;
	if (z <= -0.018) {
		tmp = t_0;
	} else if (z <= -3.8e-294) {
		tmp = x * -3.0;
	} else if (z <= 6.2e-125) {
		tmp = y * 4.0;
	} else if (z <= 0.5) {
		tmp = x * -3.0;
	} else {
		tmp = t_0;
	}
	return tmp;
}
def code(x, y, z):
	t_0 = -6.0 * ((y - x) * z)
	tmp = 0
	if z <= -0.018:
		tmp = t_0
	elif z <= -3.8e-294:
		tmp = x * -3.0
	elif z <= 6.2e-125:
		tmp = y * 4.0
	elif z <= 0.5:
		tmp = x * -3.0
	else:
		tmp = t_0
	return tmp
function code(x, y, z)
	t_0 = Float64(-6.0 * Float64(Float64(y - x) * z))
	tmp = 0.0
	if (z <= -0.018)
		tmp = t_0;
	elseif (z <= -3.8e-294)
		tmp = Float64(x * -3.0);
	elseif (z <= 6.2e-125)
		tmp = Float64(y * 4.0);
	elseif (z <= 0.5)
		tmp = Float64(x * -3.0);
	else
		tmp = t_0;
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	t_0 = -6.0 * ((y - x) * z);
	tmp = 0.0;
	if (z <= -0.018)
		tmp = t_0;
	elseif (z <= -3.8e-294)
		tmp = x * -3.0;
	elseif (z <= 6.2e-125)
		tmp = y * 4.0;
	elseif (z <= 0.5)
		tmp = x * -3.0;
	else
		tmp = t_0;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := Block[{t$95$0 = N[(-6.0 * N[(N[(y - x), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -0.018], t$95$0, If[LessEqual[z, -3.8e-294], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 6.2e-125], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 0.5], N[(x * -3.0), $MachinePrecision], t$95$0]]]]]
\begin{array}{l}

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

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

\mathbf{elif}\;z \leq 6.2 \cdot 10^{-125}:\\
\;\;\;\;y \cdot 4\\

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

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


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

    1. Initial program 99.7%

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

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

      \[\leadsto \color{blue}{x + \left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right)} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. add-sqr-sqrt52.9%

        \[\leadsto \color{blue}{\sqrt{x} \cdot \sqrt{x}} + \left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right) \]
      2. fma-define52.9%

        \[\leadsto \color{blue}{\mathsf{fma}\left(\sqrt{x}, \sqrt{x}, \left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right)\right)} \]
      3. associate-*l*52.9%

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

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

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

    if -0.0179999999999999986 < z < -3.8e-294 or 6.20000000000000026e-125 < z < 0.5

    1. Initial program 99.2%

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

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

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

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

        \[\leadsto \mathsf{fma}\left(y - x, 6 \cdot \color{blue}{\left(\frac{2}{3} + \left(-z\right)\right)}, x\right) \]
      5. distribute-rgt-in99.7%

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

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

        \[\leadsto \mathsf{fma}\left(y - x, \color{blue}{4} + \left(-z\right) \cdot 6, x\right) \]
      8. distribute-lft-neg-out99.7%

        \[\leadsto \mathsf{fma}\left(y - x, 4 + \color{blue}{\left(-z \cdot 6\right)}, x\right) \]
      9. distribute-rgt-neg-in99.7%

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

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

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

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

        \[\leadsto \color{blue}{1 \cdot x} + -1 \cdot \left(x \cdot \left(4 + -6 \cdot z\right)\right) \]
      2. *-commutative56.9%

        \[\leadsto 1 \cdot x + -1 \cdot \color{blue}{\left(\left(4 + -6 \cdot z\right) \cdot x\right)} \]
      3. +-commutative56.9%

        \[\leadsto 1 \cdot x + -1 \cdot \left(\color{blue}{\left(-6 \cdot z + 4\right)} \cdot x\right) \]
      4. *-commutative56.9%

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

        \[\leadsto 1 \cdot x + -1 \cdot \left(\color{blue}{\mathsf{fma}\left(z, -6, 4\right)} \cdot x\right) \]
      6. associate-*r*56.9%

        \[\leadsto 1 \cdot x + \color{blue}{\left(-1 \cdot \mathsf{fma}\left(z, -6, 4\right)\right) \cdot x} \]
      7. neg-mul-156.9%

        \[\leadsto 1 \cdot x + \color{blue}{\left(-\mathsf{fma}\left(z, -6, 4\right)\right)} \cdot x \]
      8. fma-define56.9%

        \[\leadsto 1 \cdot x + \left(-\color{blue}{\left(z \cdot -6 + 4\right)}\right) \cdot x \]
      9. distribute-neg-in56.9%

        \[\leadsto 1 \cdot x + \color{blue}{\left(\left(-z \cdot -6\right) + \left(-4\right)\right)} \cdot x \]
      10. distribute-lft-neg-in56.9%

        \[\leadsto 1 \cdot x + \left(\color{blue}{\left(-z\right) \cdot -6} + \left(-4\right)\right) \cdot x \]
      11. metadata-eval56.9%

        \[\leadsto 1 \cdot x + \left(\left(-z\right) \cdot -6 + \color{blue}{-4}\right) \cdot x \]
      12. metadata-eval56.9%

        \[\leadsto 1 \cdot x + \left(\left(-z\right) \cdot -6 + \color{blue}{0.6666666666666666 \cdot -6}\right) \cdot x \]
      13. distribute-rgt-in56.9%

        \[\leadsto 1 \cdot x + \color{blue}{\left(-6 \cdot \left(\left(-z\right) + 0.6666666666666666\right)\right)} \cdot x \]
      14. +-commutative56.9%

        \[\leadsto 1 \cdot x + \left(-6 \cdot \color{blue}{\left(0.6666666666666666 + \left(-z\right)\right)}\right) \cdot x \]
      15. sub-neg56.9%

        \[\leadsto 1 \cdot x + \left(-6 \cdot \color{blue}{\left(0.6666666666666666 - z\right)}\right) \cdot x \]
      16. distribute-rgt-in56.9%

        \[\leadsto \color{blue}{x \cdot \left(1 + -6 \cdot \left(0.6666666666666666 - z\right)\right)} \]
      17. sub-neg56.9%

        \[\leadsto x \cdot \left(1 + -6 \cdot \color{blue}{\left(0.6666666666666666 + \left(-z\right)\right)}\right) \]
      18. distribute-rgt-in56.9%

        \[\leadsto x \cdot \left(1 + \color{blue}{\left(0.6666666666666666 \cdot -6 + \left(-z\right) \cdot -6\right)}\right) \]
      19. metadata-eval56.9%

        \[\leadsto x \cdot \left(1 + \left(\color{blue}{-4} + \left(-z\right) \cdot -6\right)\right) \]
      20. distribute-lft-neg-in56.9%

        \[\leadsto x \cdot \left(1 + \left(-4 + \color{blue}{\left(-z \cdot -6\right)}\right)\right) \]
      21. associate-+r+56.9%

        \[\leadsto x \cdot \color{blue}{\left(\left(1 + -4\right) + \left(-z \cdot -6\right)\right)} \]
    7. Simplified56.9%

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

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

        \[\leadsto \color{blue}{x \cdot -3} \]
    10. Simplified56.6%

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

    if -3.8e-294 < z < 6.20000000000000026e-125

    1. Initial program 99.3%

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

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

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

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

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

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

Alternative 9: 52.4% accurate, 0.5× speedup?

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

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

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

\mathbf{elif}\;z \leq 4.3 \cdot 10^{-125}:\\
\;\;\;\;y \cdot 4\\

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

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


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

    1. Initial program 99.7%

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

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

      \[\leadsto \color{blue}{x + \left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right)} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. add-sqr-sqrt52.9%

        \[\leadsto \color{blue}{\sqrt{x} \cdot \sqrt{x}} + \left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right) \]
      2. fma-define52.9%

        \[\leadsto \color{blue}{\mathsf{fma}\left(\sqrt{x}, \sqrt{x}, \left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right)\right)} \]
      3. associate-*l*52.9%

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

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

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

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

    if -0.5 < z < -3.8000000000000002e-296 or 4.3000000000000002e-125 < z < 0.52000000000000002

    1. Initial program 99.2%

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

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

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

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

        \[\leadsto \mathsf{fma}\left(y - x, 6 \cdot \color{blue}{\left(\frac{2}{3} + \left(-z\right)\right)}, x\right) \]
      5. distribute-rgt-in99.7%

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

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

        \[\leadsto \mathsf{fma}\left(y - x, \color{blue}{4} + \left(-z\right) \cdot 6, x\right) \]
      8. distribute-lft-neg-out99.7%

        \[\leadsto \mathsf{fma}\left(y - x, 4 + \color{blue}{\left(-z \cdot 6\right)}, x\right) \]
      9. distribute-rgt-neg-in99.7%

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

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

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

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

        \[\leadsto \color{blue}{1 \cdot x} + -1 \cdot \left(x \cdot \left(4 + -6 \cdot z\right)\right) \]
      2. *-commutative56.9%

        \[\leadsto 1 \cdot x + -1 \cdot \color{blue}{\left(\left(4 + -6 \cdot z\right) \cdot x\right)} \]
      3. +-commutative56.9%

        \[\leadsto 1 \cdot x + -1 \cdot \left(\color{blue}{\left(-6 \cdot z + 4\right)} \cdot x\right) \]
      4. *-commutative56.9%

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

        \[\leadsto 1 \cdot x + -1 \cdot \left(\color{blue}{\mathsf{fma}\left(z, -6, 4\right)} \cdot x\right) \]
      6. associate-*r*56.9%

        \[\leadsto 1 \cdot x + \color{blue}{\left(-1 \cdot \mathsf{fma}\left(z, -6, 4\right)\right) \cdot x} \]
      7. neg-mul-156.9%

        \[\leadsto 1 \cdot x + \color{blue}{\left(-\mathsf{fma}\left(z, -6, 4\right)\right)} \cdot x \]
      8. fma-define56.9%

        \[\leadsto 1 \cdot x + \left(-\color{blue}{\left(z \cdot -6 + 4\right)}\right) \cdot x \]
      9. distribute-neg-in56.9%

        \[\leadsto 1 \cdot x + \color{blue}{\left(\left(-z \cdot -6\right) + \left(-4\right)\right)} \cdot x \]
      10. distribute-lft-neg-in56.9%

        \[\leadsto 1 \cdot x + \left(\color{blue}{\left(-z\right) \cdot -6} + \left(-4\right)\right) \cdot x \]
      11. metadata-eval56.9%

        \[\leadsto 1 \cdot x + \left(\left(-z\right) \cdot -6 + \color{blue}{-4}\right) \cdot x \]
      12. metadata-eval56.9%

        \[\leadsto 1 \cdot x + \left(\left(-z\right) \cdot -6 + \color{blue}{0.6666666666666666 \cdot -6}\right) \cdot x \]
      13. distribute-rgt-in56.9%

        \[\leadsto 1 \cdot x + \color{blue}{\left(-6 \cdot \left(\left(-z\right) + 0.6666666666666666\right)\right)} \cdot x \]
      14. +-commutative56.9%

        \[\leadsto 1 \cdot x + \left(-6 \cdot \color{blue}{\left(0.6666666666666666 + \left(-z\right)\right)}\right) \cdot x \]
      15. sub-neg56.9%

        \[\leadsto 1 \cdot x + \left(-6 \cdot \color{blue}{\left(0.6666666666666666 - z\right)}\right) \cdot x \]
      16. distribute-rgt-in56.9%

        \[\leadsto \color{blue}{x \cdot \left(1 + -6 \cdot \left(0.6666666666666666 - z\right)\right)} \]
      17. sub-neg56.9%

        \[\leadsto x \cdot \left(1 + -6 \cdot \color{blue}{\left(0.6666666666666666 + \left(-z\right)\right)}\right) \]
      18. distribute-rgt-in56.9%

        \[\leadsto x \cdot \left(1 + \color{blue}{\left(0.6666666666666666 \cdot -6 + \left(-z\right) \cdot -6\right)}\right) \]
      19. metadata-eval56.9%

        \[\leadsto x \cdot \left(1 + \left(\color{blue}{-4} + \left(-z\right) \cdot -6\right)\right) \]
      20. distribute-lft-neg-in56.9%

        \[\leadsto x \cdot \left(1 + \left(-4 + \color{blue}{\left(-z \cdot -6\right)}\right)\right) \]
      21. associate-+r+56.9%

        \[\leadsto x \cdot \color{blue}{\left(\left(1 + -4\right) + \left(-z \cdot -6\right)\right)} \]
    7. Simplified56.9%

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

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

        \[\leadsto \color{blue}{x \cdot -3} \]
    10. Simplified56.6%

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

    if -3.8000000000000002e-296 < z < 4.3000000000000002e-125

    1. Initial program 99.3%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -0.5:\\ \;\;\;\;-6 \cdot \left(y \cdot z\right)\\ \mathbf{elif}\;z \leq -3.8 \cdot 10^{-296}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 4.3 \cdot 10^{-125}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 0.52:\\ \;\;\;\;x \cdot -3\\ \mathbf{else}:\\ \;\;\;\;-6 \cdot \left(y \cdot z\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 10: 75.5% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -8.5 \cdot 10^{-24} \lor \neg \left(x \leq 9.5 \cdot 10^{+26}\right):\\
\;\;\;\;x \cdot \left(-3 + z \cdot 6\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -8.5000000000000002e-24 or 9.50000000000000054e26 < x

    1. Initial program 99.4%

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

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

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

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

        \[\leadsto \mathsf{fma}\left(y - x, 6 \cdot \color{blue}{\left(\frac{2}{3} + \left(-z\right)\right)}, x\right) \]
      5. distribute-rgt-in99.7%

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

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

        \[\leadsto \mathsf{fma}\left(y - x, \color{blue}{4} + \left(-z\right) \cdot 6, x\right) \]
      8. distribute-lft-neg-out99.7%

        \[\leadsto \mathsf{fma}\left(y - x, 4 + \color{blue}{\left(-z \cdot 6\right)}, x\right) \]
      9. distribute-rgt-neg-in99.7%

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

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

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

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

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

        \[\leadsto 1 \cdot x + -1 \cdot \color{blue}{\left(\left(4 + -6 \cdot z\right) \cdot x\right)} \]
      3. +-commutative79.5%

        \[\leadsto 1 \cdot x + -1 \cdot \left(\color{blue}{\left(-6 \cdot z + 4\right)} \cdot x\right) \]
      4. *-commutative79.5%

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

        \[\leadsto 1 \cdot x + -1 \cdot \left(\color{blue}{\mathsf{fma}\left(z, -6, 4\right)} \cdot x\right) \]
      6. associate-*r*79.5%

        \[\leadsto 1 \cdot x + \color{blue}{\left(-1 \cdot \mathsf{fma}\left(z, -6, 4\right)\right) \cdot x} \]
      7. neg-mul-179.5%

        \[\leadsto 1 \cdot x + \color{blue}{\left(-\mathsf{fma}\left(z, -6, 4\right)\right)} \cdot x \]
      8. fma-define79.5%

        \[\leadsto 1 \cdot x + \left(-\color{blue}{\left(z \cdot -6 + 4\right)}\right) \cdot x \]
      9. distribute-neg-in79.5%

        \[\leadsto 1 \cdot x + \color{blue}{\left(\left(-z \cdot -6\right) + \left(-4\right)\right)} \cdot x \]
      10. distribute-lft-neg-in79.5%

        \[\leadsto 1 \cdot x + \left(\color{blue}{\left(-z\right) \cdot -6} + \left(-4\right)\right) \cdot x \]
      11. metadata-eval79.5%

        \[\leadsto 1 \cdot x + \left(\left(-z\right) \cdot -6 + \color{blue}{-4}\right) \cdot x \]
      12. metadata-eval79.5%

        \[\leadsto 1 \cdot x + \left(\left(-z\right) \cdot -6 + \color{blue}{0.6666666666666666 \cdot -6}\right) \cdot x \]
      13. distribute-rgt-in79.5%

        \[\leadsto 1 \cdot x + \color{blue}{\left(-6 \cdot \left(\left(-z\right) + 0.6666666666666666\right)\right)} \cdot x \]
      14. +-commutative79.5%

        \[\leadsto 1 \cdot x + \left(-6 \cdot \color{blue}{\left(0.6666666666666666 + \left(-z\right)\right)}\right) \cdot x \]
      15. sub-neg79.5%

        \[\leadsto 1 \cdot x + \left(-6 \cdot \color{blue}{\left(0.6666666666666666 - z\right)}\right) \cdot x \]
      16. distribute-rgt-in79.6%

        \[\leadsto \color{blue}{x \cdot \left(1 + -6 \cdot \left(0.6666666666666666 - z\right)\right)} \]
      17. sub-neg79.6%

        \[\leadsto x \cdot \left(1 + -6 \cdot \color{blue}{\left(0.6666666666666666 + \left(-z\right)\right)}\right) \]
      18. distribute-rgt-in79.5%

        \[\leadsto x \cdot \left(1 + \color{blue}{\left(0.6666666666666666 \cdot -6 + \left(-z\right) \cdot -6\right)}\right) \]
      19. metadata-eval79.5%

        \[\leadsto x \cdot \left(1 + \left(\color{blue}{-4} + \left(-z\right) \cdot -6\right)\right) \]
      20. distribute-lft-neg-in79.5%

        \[\leadsto x \cdot \left(1 + \left(-4 + \color{blue}{\left(-z \cdot -6\right)}\right)\right) \]
      21. associate-+r+79.5%

        \[\leadsto x \cdot \color{blue}{\left(\left(1 + -4\right) + \left(-z \cdot -6\right)\right)} \]
    7. Simplified79.5%

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

    if -8.5000000000000002e-24 < x < 9.50000000000000054e26

    1. Initial program 99.5%

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

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

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

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

        \[\leadsto \mathsf{fma}\left(y - x, 6 \cdot \color{blue}{\left(\frac{2}{3} + \left(-z\right)\right)}, x\right) \]
      5. distribute-rgt-in99.8%

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

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

        \[\leadsto \mathsf{fma}\left(y - x, \color{blue}{4} + \left(-z\right) \cdot 6, x\right) \]
      8. distribute-lft-neg-out99.8%

        \[\leadsto \mathsf{fma}\left(y - x, 4 + \color{blue}{\left(-z \cdot 6\right)}, x\right) \]
      9. distribute-rgt-neg-in99.8%

        \[\leadsto \mathsf{fma}\left(y - x, 4 + \color{blue}{z \cdot \left(-6\right)}, x\right) \]
      10. metadata-eval99.8%

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

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

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

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

Alternative 11: 98.0% accurate, 0.8× speedup?

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

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

\mathbf{elif}\;z \leq 0.6:\\
\;\;\;\;y \cdot 4 + x \cdot -3\\

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


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

    1. Initial program 99.8%

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

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

      \[\leadsto \color{blue}{x + \left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right)} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. add-sqr-sqrt52.9%

        \[\leadsto \color{blue}{\sqrt{x} \cdot \sqrt{x}} + \left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right) \]
      2. fma-define52.9%

        \[\leadsto \color{blue}{\mathsf{fma}\left(\sqrt{x}, \sqrt{x}, \left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right)\right)} \]
      3. associate-*l*52.9%

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

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

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

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

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

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

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

    if -0.599999999999999978 < z < 0.599999999999999978

    1. Initial program 99.2%

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

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

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

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

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

    if 0.599999999999999978 < z

    1. Initial program 99.6%

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

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

      \[\leadsto \color{blue}{x + \left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right)} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. add-sqr-sqrt52.1%

        \[\leadsto \color{blue}{\sqrt{x} \cdot \sqrt{x}} + \left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right) \]
      2. fma-define52.1%

        \[\leadsto \color{blue}{\mathsf{fma}\left(\sqrt{x}, \sqrt{x}, \left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right)\right)} \]
      3. associate-*l*52.1%

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

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

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

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

Alternative 12: 98.0% accurate, 0.8× speedup?

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

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

\mathbf{elif}\;z \leq 0.58:\\
\;\;\;\;x + \left(y - x\right) \cdot 4\\

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


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

    1. Initial program 99.8%

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

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

      \[\leadsto \color{blue}{x + \left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right)} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. add-sqr-sqrt52.9%

        \[\leadsto \color{blue}{\sqrt{x} \cdot \sqrt{x}} + \left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right) \]
      2. fma-define52.9%

        \[\leadsto \color{blue}{\mathsf{fma}\left(\sqrt{x}, \sqrt{x}, \left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right)\right)} \]
      3. associate-*l*52.9%

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

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

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

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

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

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

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

    if -0.57999999999999996 < z < 0.57999999999999996

    1. Initial program 99.2%

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

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

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

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

    if 0.57999999999999996 < z

    1. Initial program 99.6%

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

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

      \[\leadsto \color{blue}{x + \left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right)} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. add-sqr-sqrt52.1%

        \[\leadsto \color{blue}{\sqrt{x} \cdot \sqrt{x}} + \left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right) \]
      2. fma-define52.1%

        \[\leadsto \color{blue}{\mathsf{fma}\left(\sqrt{x}, \sqrt{x}, \left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right)\right)} \]
      3. associate-*l*52.1%

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

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

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

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

Alternative 13: 36.2% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -3 \cdot 10^{+105} \lor \neg \left(x \leq 4.8 \cdot 10^{-86}\right):\\
\;\;\;\;x \cdot -3\\

\mathbf{else}:\\
\;\;\;\;y \cdot 4\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -3.0000000000000001e105 or 4.80000000000000026e-86 < x

    1. Initial program 99.4%

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

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

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

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

        \[\leadsto \mathsf{fma}\left(y - x, 6 \cdot \color{blue}{\left(\frac{2}{3} + \left(-z\right)\right)}, x\right) \]
      5. distribute-rgt-in99.7%

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

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

        \[\leadsto \mathsf{fma}\left(y - x, \color{blue}{4} + \left(-z\right) \cdot 6, x\right) \]
      8. distribute-lft-neg-out99.7%

        \[\leadsto \mathsf{fma}\left(y - x, 4 + \color{blue}{\left(-z \cdot 6\right)}, x\right) \]
      9. distribute-rgt-neg-in99.7%

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

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

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

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

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

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

        \[\leadsto 1 \cdot x + -1 \cdot \left(\color{blue}{\left(-6 \cdot z + 4\right)} \cdot x\right) \]
      4. *-commutative77.8%

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

        \[\leadsto 1 \cdot x + -1 \cdot \left(\color{blue}{\mathsf{fma}\left(z, -6, 4\right)} \cdot x\right) \]
      6. associate-*r*77.8%

        \[\leadsto 1 \cdot x + \color{blue}{\left(-1 \cdot \mathsf{fma}\left(z, -6, 4\right)\right) \cdot x} \]
      7. neg-mul-177.8%

        \[\leadsto 1 \cdot x + \color{blue}{\left(-\mathsf{fma}\left(z, -6, 4\right)\right)} \cdot x \]
      8. fma-define77.8%

        \[\leadsto 1 \cdot x + \left(-\color{blue}{\left(z \cdot -6 + 4\right)}\right) \cdot x \]
      9. distribute-neg-in77.8%

        \[\leadsto 1 \cdot x + \color{blue}{\left(\left(-z \cdot -6\right) + \left(-4\right)\right)} \cdot x \]
      10. distribute-lft-neg-in77.8%

        \[\leadsto 1 \cdot x + \left(\color{blue}{\left(-z\right) \cdot -6} + \left(-4\right)\right) \cdot x \]
      11. metadata-eval77.8%

        \[\leadsto 1 \cdot x + \left(\left(-z\right) \cdot -6 + \color{blue}{-4}\right) \cdot x \]
      12. metadata-eval77.8%

        \[\leadsto 1 \cdot x + \left(\left(-z\right) \cdot -6 + \color{blue}{0.6666666666666666 \cdot -6}\right) \cdot x \]
      13. distribute-rgt-in77.8%

        \[\leadsto 1 \cdot x + \color{blue}{\left(-6 \cdot \left(\left(-z\right) + 0.6666666666666666\right)\right)} \cdot x \]
      14. +-commutative77.8%

        \[\leadsto 1 \cdot x + \left(-6 \cdot \color{blue}{\left(0.6666666666666666 + \left(-z\right)\right)}\right) \cdot x \]
      15. sub-neg77.8%

        \[\leadsto 1 \cdot x + \left(-6 \cdot \color{blue}{\left(0.6666666666666666 - z\right)}\right) \cdot x \]
      16. distribute-rgt-in77.9%

        \[\leadsto \color{blue}{x \cdot \left(1 + -6 \cdot \left(0.6666666666666666 - z\right)\right)} \]
      17. sub-neg77.9%

        \[\leadsto x \cdot \left(1 + -6 \cdot \color{blue}{\left(0.6666666666666666 + \left(-z\right)\right)}\right) \]
      18. distribute-rgt-in77.9%

        \[\leadsto x \cdot \left(1 + \color{blue}{\left(0.6666666666666666 \cdot -6 + \left(-z\right) \cdot -6\right)}\right) \]
      19. metadata-eval77.9%

        \[\leadsto x \cdot \left(1 + \left(\color{blue}{-4} + \left(-z\right) \cdot -6\right)\right) \]
      20. distribute-lft-neg-in77.9%

        \[\leadsto x \cdot \left(1 + \left(-4 + \color{blue}{\left(-z \cdot -6\right)}\right)\right) \]
      21. associate-+r+77.9%

        \[\leadsto x \cdot \color{blue}{\left(\left(1 + -4\right) + \left(-z \cdot -6\right)\right)} \]
    7. Simplified77.9%

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

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

        \[\leadsto \color{blue}{x \cdot -3} \]
    10. Simplified40.9%

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

    if -3.0000000000000001e105 < x < 4.80000000000000026e-86

    1. Initial program 99.5%

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

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

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

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

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

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

Alternative 14: 99.8% accurate, 1.2× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto x + \left(4 \cdot \left(y - x\right) + \color{blue}{\left(-6 \cdot z\right) \cdot \left(y - x\right)}\right) \]
    3. distribute-rgt-out99.7%

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

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

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

Alternative 15: 99.5% accurate, 1.2× speedup?

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

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

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

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

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

Alternative 16: 25.5% accurate, 4.3× speedup?

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

\\
y \cdot 4
\end{array}
Derivation
  1. Initial program 99.5%

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

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

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

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

    \[\leadsto \color{blue}{4 \cdot y} \]
  7. Final simplification25.5%

    \[\leadsto y \cdot 4 \]
  8. Add Preprocessing

Alternative 17: 2.6% accurate, 13.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 \left(\frac{2}{3} - z\right) \]
  2. Step-by-step derivation
    1. metadata-eval99.5%

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

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

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

    \[\leadsto \color{blue}{x} \]
  7. Add Preprocessing

Reproduce

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