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

Percentage Accurate: 99.7% → 99.8%
Time: 9.4s
Alternatives: 11
Speedup: 1.0×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 11 alternatives:

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

Initial Program: 99.7% accurate, 1.0× speedup?

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

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

Alternative 1: 99.8% accurate, 1.0× speedup?

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

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

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

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

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

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

Alternative 2: 61.4% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := y \cdot \left(6 \cdot z\right)\\ t_1 := -6 \cdot \left(x \cdot z\right)\\ \mathbf{if}\;z \leq -2.45 \cdot 10^{+247}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;z \leq -9.5 \cdot 10^{+228}:\\ \;\;\;\;x \cdot \left(z \cdot -6\right)\\ \mathbf{elif}\;z \leq -3.1 \cdot 10^{+212}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;z \leq -1.85 \cdot 10^{+98}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq -6.6 \cdot 10^{-22}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;z \leq 4.6 \cdot 10^{-16}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 2.3 \cdot 10^{+166} \lor \neg \left(z \leq 6.5 \cdot 10^{+207}\right):\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (let* ((t_0 (* y (* 6.0 z))) (t_1 (* -6.0 (* x z))))
   (if (<= z -2.45e+247)
     t_0
     (if (<= z -9.5e+228)
       (* x (* z -6.0))
       (if (<= z -3.1e+212)
         t_0
         (if (<= z -1.85e+98)
           t_1
           (if (<= z -6.6e-22)
             t_0
             (if (<= z 4.6e-16)
               x
               (if (or (<= z 2.3e+166) (not (<= z 6.5e+207))) t_0 t_1)))))))))
double code(double x, double y, double z) {
	double t_0 = y * (6.0 * z);
	double t_1 = -6.0 * (x * z);
	double tmp;
	if (z <= -2.45e+247) {
		tmp = t_0;
	} else if (z <= -9.5e+228) {
		tmp = x * (z * -6.0);
	} else if (z <= -3.1e+212) {
		tmp = t_0;
	} else if (z <= -1.85e+98) {
		tmp = t_1;
	} else if (z <= -6.6e-22) {
		tmp = t_0;
	} else if (z <= 4.6e-16) {
		tmp = x;
	} else if ((z <= 2.3e+166) || !(z <= 6.5e+207)) {
		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 = y * (6.0d0 * z)
    t_1 = (-6.0d0) * (x * z)
    if (z <= (-2.45d+247)) then
        tmp = t_0
    else if (z <= (-9.5d+228)) then
        tmp = x * (z * (-6.0d0))
    else if (z <= (-3.1d+212)) then
        tmp = t_0
    else if (z <= (-1.85d+98)) then
        tmp = t_1
    else if (z <= (-6.6d-22)) then
        tmp = t_0
    else if (z <= 4.6d-16) then
        tmp = x
    else if ((z <= 2.3d+166) .or. (.not. (z <= 6.5d+207))) 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 = y * (6.0 * z);
	double t_1 = -6.0 * (x * z);
	double tmp;
	if (z <= -2.45e+247) {
		tmp = t_0;
	} else if (z <= -9.5e+228) {
		tmp = x * (z * -6.0);
	} else if (z <= -3.1e+212) {
		tmp = t_0;
	} else if (z <= -1.85e+98) {
		tmp = t_1;
	} else if (z <= -6.6e-22) {
		tmp = t_0;
	} else if (z <= 4.6e-16) {
		tmp = x;
	} else if ((z <= 2.3e+166) || !(z <= 6.5e+207)) {
		tmp = t_0;
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z):
	t_0 = y * (6.0 * z)
	t_1 = -6.0 * (x * z)
	tmp = 0
	if z <= -2.45e+247:
		tmp = t_0
	elif z <= -9.5e+228:
		tmp = x * (z * -6.0)
	elif z <= -3.1e+212:
		tmp = t_0
	elif z <= -1.85e+98:
		tmp = t_1
	elif z <= -6.6e-22:
		tmp = t_0
	elif z <= 4.6e-16:
		tmp = x
	elif (z <= 2.3e+166) or not (z <= 6.5e+207):
		tmp = t_0
	else:
		tmp = t_1
	return tmp
function code(x, y, z)
	t_0 = Float64(y * Float64(6.0 * z))
	t_1 = Float64(-6.0 * Float64(x * z))
	tmp = 0.0
	if (z <= -2.45e+247)
		tmp = t_0;
	elseif (z <= -9.5e+228)
		tmp = Float64(x * Float64(z * -6.0));
	elseif (z <= -3.1e+212)
		tmp = t_0;
	elseif (z <= -1.85e+98)
		tmp = t_1;
	elseif (z <= -6.6e-22)
		tmp = t_0;
	elseif (z <= 4.6e-16)
		tmp = x;
	elseif ((z <= 2.3e+166) || !(z <= 6.5e+207))
		tmp = t_0;
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	t_0 = y * (6.0 * z);
	t_1 = -6.0 * (x * z);
	tmp = 0.0;
	if (z <= -2.45e+247)
		tmp = t_0;
	elseif (z <= -9.5e+228)
		tmp = x * (z * -6.0);
	elseif (z <= -3.1e+212)
		tmp = t_0;
	elseif (z <= -1.85e+98)
		tmp = t_1;
	elseif (z <= -6.6e-22)
		tmp = t_0;
	elseif (z <= 4.6e-16)
		tmp = x;
	elseif ((z <= 2.3e+166) || ~((z <= 6.5e+207)))
		tmp = t_0;
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := Block[{t$95$0 = N[(y * N[(6.0 * z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(-6.0 * N[(x * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2.45e+247], t$95$0, If[LessEqual[z, -9.5e+228], N[(x * N[(z * -6.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -3.1e+212], t$95$0, If[LessEqual[z, -1.85e+98], t$95$1, If[LessEqual[z, -6.6e-22], t$95$0, If[LessEqual[z, 4.6e-16], x, If[Or[LessEqual[z, 2.3e+166], N[Not[LessEqual[z, 6.5e+207]], $MachinePrecision]], t$95$0, t$95$1]]]]]]]]]
\begin{array}{l}

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

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

\mathbf{elif}\;z \leq -3.1 \cdot 10^{+212}:\\
\;\;\;\;t_0\\

\mathbf{elif}\;z \leq -1.85 \cdot 10^{+98}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;z \leq -6.6 \cdot 10^{-22}:\\
\;\;\;\;t_0\\

\mathbf{elif}\;z \leq 4.6 \cdot 10^{-16}:\\
\;\;\;\;x\\

\mathbf{elif}\;z \leq 2.3 \cdot 10^{+166} \lor \neg \left(z \leq 6.5 \cdot 10^{+207}\right):\\
\;\;\;\;t_0\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -2.4499999999999999e247 or -9.50000000000000046e228 < z < -3.09999999999999998e212 or -1.8499999999999999e98 < z < -6.6000000000000002e-22 or 4.5999999999999998e-16 < z < 2.30000000000000008e166 or 6.5000000000000001e207 < z

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(z, \color{blue}{\left(\left(-y\right) + \left(-\left(-x\right)\right)\right)} \cdot \left(-6\right), x\right) \]
      9. remove-double-neg99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.4499999999999999e247 < z < -9.50000000000000046e228

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(z, \color{blue}{\left(\left(-y\right) + \left(-\left(-x\right)\right)\right)} \cdot \left(-6\right), x\right) \]
      9. remove-double-neg99.8%

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

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

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

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

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

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

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

        \[\leadsto -6 \cdot \color{blue}{{\left(\sqrt{z \cdot \left(x - y\right)}\right)}^{2}} \]
    6. Applied egg-rr62.3%

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

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

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

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

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

    if -3.09999999999999998e212 < z < -1.8499999999999999e98 or 2.30000000000000008e166 < z < 6.5000000000000001e207

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(z, \color{blue}{\left(\left(-y\right) + \left(-\left(-x\right)\right)\right)} \cdot \left(-6\right), x\right) \]
      9. remove-double-neg99.9%

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

        \[\leadsto \mathsf{fma}\left(z, \color{blue}{\left(x + \left(-y\right)\right)} \cdot \left(-6\right), x\right) \]
      11. sub-neg99.9%

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

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

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

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

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

    if -6.6000000000000002e-22 < z < 4.5999999999999998e-16

    1. Initial program 99.1%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -2.45 \cdot 10^{+247}:\\ \;\;\;\;y \cdot \left(6 \cdot z\right)\\ \mathbf{elif}\;z \leq -9.5 \cdot 10^{+228}:\\ \;\;\;\;x \cdot \left(z \cdot -6\right)\\ \mathbf{elif}\;z \leq -3.1 \cdot 10^{+212}:\\ \;\;\;\;y \cdot \left(6 \cdot z\right)\\ \mathbf{elif}\;z \leq -1.85 \cdot 10^{+98}:\\ \;\;\;\;-6 \cdot \left(x \cdot z\right)\\ \mathbf{elif}\;z \leq -6.6 \cdot 10^{-22}:\\ \;\;\;\;y \cdot \left(6 \cdot z\right)\\ \mathbf{elif}\;z \leq 4.6 \cdot 10^{-16}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 2.3 \cdot 10^{+166} \lor \neg \left(z \leq 6.5 \cdot 10^{+207}\right):\\ \;\;\;\;y \cdot \left(6 \cdot z\right)\\ \mathbf{else}:\\ \;\;\;\;-6 \cdot \left(x \cdot z\right)\\ \end{array} \]

Alternative 3: 61.4% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := y \cdot \left(6 \cdot z\right)\\ \mathbf{if}\;z \leq -2.35 \cdot 10^{+247}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;z \leq -4 \cdot 10^{+228}:\\ \;\;\;\;x \cdot \left(z \cdot -6\right)\\ \mathbf{elif}\;z \leq -6.6 \cdot 10^{+212}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;z \leq -3.5 \cdot 10^{+103}:\\ \;\;\;\;z \cdot \left(x \cdot -6\right)\\ \mathbf{elif}\;z \leq -5.2 \cdot 10^{-20}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;z \leq 2.6 \cdot 10^{-14}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 2.15 \cdot 10^{+166} \lor \neg \left(z \leq 4 \cdot 10^{+206}\right):\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;-6 \cdot \left(x \cdot z\right)\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (let* ((t_0 (* y (* 6.0 z))))
   (if (<= z -2.35e+247)
     t_0
     (if (<= z -4e+228)
       (* x (* z -6.0))
       (if (<= z -6.6e+212)
         t_0
         (if (<= z -3.5e+103)
           (* z (* x -6.0))
           (if (<= z -5.2e-20)
             t_0
             (if (<= z 2.6e-14)
               x
               (if (or (<= z 2.15e+166) (not (<= z 4e+206)))
                 t_0
                 (* -6.0 (* x z)))))))))))
double code(double x, double y, double z) {
	double t_0 = y * (6.0 * z);
	double tmp;
	if (z <= -2.35e+247) {
		tmp = t_0;
	} else if (z <= -4e+228) {
		tmp = x * (z * -6.0);
	} else if (z <= -6.6e+212) {
		tmp = t_0;
	} else if (z <= -3.5e+103) {
		tmp = z * (x * -6.0);
	} else if (z <= -5.2e-20) {
		tmp = t_0;
	} else if (z <= 2.6e-14) {
		tmp = x;
	} else if ((z <= 2.15e+166) || !(z <= 4e+206)) {
		tmp = t_0;
	} else {
		tmp = -6.0 * (x * z);
	}
	return tmp;
}
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8) :: t_0
    real(8) :: tmp
    t_0 = y * (6.0d0 * z)
    if (z <= (-2.35d+247)) then
        tmp = t_0
    else if (z <= (-4d+228)) then
        tmp = x * (z * (-6.0d0))
    else if (z <= (-6.6d+212)) then
        tmp = t_0
    else if (z <= (-3.5d+103)) then
        tmp = z * (x * (-6.0d0))
    else if (z <= (-5.2d-20)) then
        tmp = t_0
    else if (z <= 2.6d-14) then
        tmp = x
    else if ((z <= 2.15d+166) .or. (.not. (z <= 4d+206))) then
        tmp = t_0
    else
        tmp = (-6.0d0) * (x * z)
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double t_0 = y * (6.0 * z);
	double tmp;
	if (z <= -2.35e+247) {
		tmp = t_0;
	} else if (z <= -4e+228) {
		tmp = x * (z * -6.0);
	} else if (z <= -6.6e+212) {
		tmp = t_0;
	} else if (z <= -3.5e+103) {
		tmp = z * (x * -6.0);
	} else if (z <= -5.2e-20) {
		tmp = t_0;
	} else if (z <= 2.6e-14) {
		tmp = x;
	} else if ((z <= 2.15e+166) || !(z <= 4e+206)) {
		tmp = t_0;
	} else {
		tmp = -6.0 * (x * z);
	}
	return tmp;
}
def code(x, y, z):
	t_0 = y * (6.0 * z)
	tmp = 0
	if z <= -2.35e+247:
		tmp = t_0
	elif z <= -4e+228:
		tmp = x * (z * -6.0)
	elif z <= -6.6e+212:
		tmp = t_0
	elif z <= -3.5e+103:
		tmp = z * (x * -6.0)
	elif z <= -5.2e-20:
		tmp = t_0
	elif z <= 2.6e-14:
		tmp = x
	elif (z <= 2.15e+166) or not (z <= 4e+206):
		tmp = t_0
	else:
		tmp = -6.0 * (x * z)
	return tmp
function code(x, y, z)
	t_0 = Float64(y * Float64(6.0 * z))
	tmp = 0.0
	if (z <= -2.35e+247)
		tmp = t_0;
	elseif (z <= -4e+228)
		tmp = Float64(x * Float64(z * -6.0));
	elseif (z <= -6.6e+212)
		tmp = t_0;
	elseif (z <= -3.5e+103)
		tmp = Float64(z * Float64(x * -6.0));
	elseif (z <= -5.2e-20)
		tmp = t_0;
	elseif (z <= 2.6e-14)
		tmp = x;
	elseif ((z <= 2.15e+166) || !(z <= 4e+206))
		tmp = t_0;
	else
		tmp = Float64(-6.0 * Float64(x * z));
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	t_0 = y * (6.0 * z);
	tmp = 0.0;
	if (z <= -2.35e+247)
		tmp = t_0;
	elseif (z <= -4e+228)
		tmp = x * (z * -6.0);
	elseif (z <= -6.6e+212)
		tmp = t_0;
	elseif (z <= -3.5e+103)
		tmp = z * (x * -6.0);
	elseif (z <= -5.2e-20)
		tmp = t_0;
	elseif (z <= 2.6e-14)
		tmp = x;
	elseif ((z <= 2.15e+166) || ~((z <= 4e+206)))
		tmp = t_0;
	else
		tmp = -6.0 * (x * z);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := Block[{t$95$0 = N[(y * N[(6.0 * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2.35e+247], t$95$0, If[LessEqual[z, -4e+228], N[(x * N[(z * -6.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -6.6e+212], t$95$0, If[LessEqual[z, -3.5e+103], N[(z * N[(x * -6.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -5.2e-20], t$95$0, If[LessEqual[z, 2.6e-14], x, If[Or[LessEqual[z, 2.15e+166], N[Not[LessEqual[z, 4e+206]], $MachinePrecision]], t$95$0, N[(-6.0 * N[(x * z), $MachinePrecision]), $MachinePrecision]]]]]]]]]
\begin{array}{l}

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

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

\mathbf{elif}\;z \leq -6.6 \cdot 10^{+212}:\\
\;\;\;\;t_0\\

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

\mathbf{elif}\;z \leq -5.2 \cdot 10^{-20}:\\
\;\;\;\;t_0\\

\mathbf{elif}\;z \leq 2.6 \cdot 10^{-14}:\\
\;\;\;\;x\\

\mathbf{elif}\;z \leq 2.15 \cdot 10^{+166} \lor \neg \left(z \leq 4 \cdot 10^{+206}\right):\\
\;\;\;\;t_0\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if z < -2.3500000000000001e247 or -3.9999999999999997e228 < z < -6.6e212 or -3.5e103 < z < -5.1999999999999999e-20 or 2.59999999999999997e-14 < z < 2.15e166 or 4.0000000000000002e206 < z

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(z, \color{blue}{\left(\left(-y\right) + \left(-\left(-x\right)\right)\right)} \cdot \left(-6\right), x\right) \]
      9. remove-double-neg99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.3500000000000001e247 < z < -3.9999999999999997e228

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(z, \color{blue}{\left(\left(-y\right) + \left(-\left(-x\right)\right)\right)} \cdot \left(-6\right), x\right) \]
      9. remove-double-neg99.8%

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

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

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

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

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

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

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

        \[\leadsto -6 \cdot \color{blue}{{\left(\sqrt{z \cdot \left(x - y\right)}\right)}^{2}} \]
    6. Applied egg-rr62.3%

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

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

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

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

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

    if -6.6e212 < z < -3.5e103

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(z, \color{blue}{\left(\left(-y\right) + \left(-\left(-x\right)\right)\right)} \cdot \left(-6\right), x\right) \]
      9. remove-double-neg99.9%

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

        \[\leadsto \mathsf{fma}\left(z, \color{blue}{\left(x + \left(-y\right)\right)} \cdot \left(-6\right), x\right) \]
      11. sub-neg99.9%

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

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

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

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

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

        \[\leadsto -6 \cdot \color{blue}{{\left(\sqrt{z \cdot \left(x - y\right)}\right)}^{2}} \]
    6. Applied egg-rr37.4%

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

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

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

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

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

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

    if -5.1999999999999999e-20 < z < 2.59999999999999997e-14

    1. Initial program 99.1%

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

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

    if 2.15e166 < z < 4.0000000000000002e206

    1. Initial program 100.0%

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(z, -\color{blue}{\left(-\left(y - x\right)\right) \cdot 6}, x\right) \]
      6. distribute-rgt-neg-in100.0%

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

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

        \[\leadsto \mathsf{fma}\left(z, \color{blue}{\left(\left(-y\right) + \left(-\left(-x\right)\right)\right)} \cdot \left(-6\right), x\right) \]
      9. remove-double-neg100.0%

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

        \[\leadsto \mathsf{fma}\left(z, \color{blue}{\left(x + \left(-y\right)\right)} \cdot \left(-6\right), x\right) \]
      11. sub-neg100.0%

        \[\leadsto \mathsf{fma}\left(z, \color{blue}{\left(x - y\right)} \cdot \left(-6\right), x\right) \]
      12. metadata-eval100.0%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -2.35 \cdot 10^{+247}:\\ \;\;\;\;y \cdot \left(6 \cdot z\right)\\ \mathbf{elif}\;z \leq -4 \cdot 10^{+228}:\\ \;\;\;\;x \cdot \left(z \cdot -6\right)\\ \mathbf{elif}\;z \leq -6.6 \cdot 10^{+212}:\\ \;\;\;\;y \cdot \left(6 \cdot z\right)\\ \mathbf{elif}\;z \leq -3.5 \cdot 10^{+103}:\\ \;\;\;\;z \cdot \left(x \cdot -6\right)\\ \mathbf{elif}\;z \leq -5.2 \cdot 10^{-20}:\\ \;\;\;\;y \cdot \left(6 \cdot z\right)\\ \mathbf{elif}\;z \leq 2.6 \cdot 10^{-14}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 2.15 \cdot 10^{+166} \lor \neg \left(z \leq 4 \cdot 10^{+206}\right):\\ \;\;\;\;y \cdot \left(6 \cdot z\right)\\ \mathbf{else}:\\ \;\;\;\;-6 \cdot \left(x \cdot z\right)\\ \end{array} \]

Alternative 4: 61.4% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := y \cdot \left(6 \cdot z\right)\\ \mathbf{if}\;z \leq -3.2 \cdot 10^{+247}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;z \leq -4.2 \cdot 10^{+228}:\\ \;\;\;\;x \cdot \left(z \cdot -6\right)\\ \mathbf{elif}\;z \leq -1.05 \cdot 10^{+212}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;z \leq -1.7 \cdot 10^{+99}:\\ \;\;\;\;z \cdot \left(x \cdot -6\right)\\ \mathbf{elif}\;z \leq -3.3 \cdot 10^{-20}:\\ \;\;\;\;z \cdot \left(y \cdot 6\right)\\ \mathbf{elif}\;z \leq 1.56 \cdot 10^{-15}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 1.8 \cdot 10^{+166} \lor \neg \left(z \leq 2.52 \cdot 10^{+207}\right):\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;-6 \cdot \left(x \cdot z\right)\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (let* ((t_0 (* y (* 6.0 z))))
   (if (<= z -3.2e+247)
     t_0
     (if (<= z -4.2e+228)
       (* x (* z -6.0))
       (if (<= z -1.05e+212)
         t_0
         (if (<= z -1.7e+99)
           (* z (* x -6.0))
           (if (<= z -3.3e-20)
             (* z (* y 6.0))
             (if (<= z 1.56e-15)
               x
               (if (or (<= z 1.8e+166) (not (<= z 2.52e+207)))
                 t_0
                 (* -6.0 (* x z)))))))))))
double code(double x, double y, double z) {
	double t_0 = y * (6.0 * z);
	double tmp;
	if (z <= -3.2e+247) {
		tmp = t_0;
	} else if (z <= -4.2e+228) {
		tmp = x * (z * -6.0);
	} else if (z <= -1.05e+212) {
		tmp = t_0;
	} else if (z <= -1.7e+99) {
		tmp = z * (x * -6.0);
	} else if (z <= -3.3e-20) {
		tmp = z * (y * 6.0);
	} else if (z <= 1.56e-15) {
		tmp = x;
	} else if ((z <= 1.8e+166) || !(z <= 2.52e+207)) {
		tmp = t_0;
	} else {
		tmp = -6.0 * (x * z);
	}
	return tmp;
}
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8) :: t_0
    real(8) :: tmp
    t_0 = y * (6.0d0 * z)
    if (z <= (-3.2d+247)) then
        tmp = t_0
    else if (z <= (-4.2d+228)) then
        tmp = x * (z * (-6.0d0))
    else if (z <= (-1.05d+212)) then
        tmp = t_0
    else if (z <= (-1.7d+99)) then
        tmp = z * (x * (-6.0d0))
    else if (z <= (-3.3d-20)) then
        tmp = z * (y * 6.0d0)
    else if (z <= 1.56d-15) then
        tmp = x
    else if ((z <= 1.8d+166) .or. (.not. (z <= 2.52d+207))) then
        tmp = t_0
    else
        tmp = (-6.0d0) * (x * z)
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double t_0 = y * (6.0 * z);
	double tmp;
	if (z <= -3.2e+247) {
		tmp = t_0;
	} else if (z <= -4.2e+228) {
		tmp = x * (z * -6.0);
	} else if (z <= -1.05e+212) {
		tmp = t_0;
	} else if (z <= -1.7e+99) {
		tmp = z * (x * -6.0);
	} else if (z <= -3.3e-20) {
		tmp = z * (y * 6.0);
	} else if (z <= 1.56e-15) {
		tmp = x;
	} else if ((z <= 1.8e+166) || !(z <= 2.52e+207)) {
		tmp = t_0;
	} else {
		tmp = -6.0 * (x * z);
	}
	return tmp;
}
def code(x, y, z):
	t_0 = y * (6.0 * z)
	tmp = 0
	if z <= -3.2e+247:
		tmp = t_0
	elif z <= -4.2e+228:
		tmp = x * (z * -6.0)
	elif z <= -1.05e+212:
		tmp = t_0
	elif z <= -1.7e+99:
		tmp = z * (x * -6.0)
	elif z <= -3.3e-20:
		tmp = z * (y * 6.0)
	elif z <= 1.56e-15:
		tmp = x
	elif (z <= 1.8e+166) or not (z <= 2.52e+207):
		tmp = t_0
	else:
		tmp = -6.0 * (x * z)
	return tmp
function code(x, y, z)
	t_0 = Float64(y * Float64(6.0 * z))
	tmp = 0.0
	if (z <= -3.2e+247)
		tmp = t_0;
	elseif (z <= -4.2e+228)
		tmp = Float64(x * Float64(z * -6.0));
	elseif (z <= -1.05e+212)
		tmp = t_0;
	elseif (z <= -1.7e+99)
		tmp = Float64(z * Float64(x * -6.0));
	elseif (z <= -3.3e-20)
		tmp = Float64(z * Float64(y * 6.0));
	elseif (z <= 1.56e-15)
		tmp = x;
	elseif ((z <= 1.8e+166) || !(z <= 2.52e+207))
		tmp = t_0;
	else
		tmp = Float64(-6.0 * Float64(x * z));
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	t_0 = y * (6.0 * z);
	tmp = 0.0;
	if (z <= -3.2e+247)
		tmp = t_0;
	elseif (z <= -4.2e+228)
		tmp = x * (z * -6.0);
	elseif (z <= -1.05e+212)
		tmp = t_0;
	elseif (z <= -1.7e+99)
		tmp = z * (x * -6.0);
	elseif (z <= -3.3e-20)
		tmp = z * (y * 6.0);
	elseif (z <= 1.56e-15)
		tmp = x;
	elseif ((z <= 1.8e+166) || ~((z <= 2.52e+207)))
		tmp = t_0;
	else
		tmp = -6.0 * (x * z);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := Block[{t$95$0 = N[(y * N[(6.0 * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -3.2e+247], t$95$0, If[LessEqual[z, -4.2e+228], N[(x * N[(z * -6.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -1.05e+212], t$95$0, If[LessEqual[z, -1.7e+99], N[(z * N[(x * -6.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -3.3e-20], N[(z * N[(y * 6.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.56e-15], x, If[Or[LessEqual[z, 1.8e+166], N[Not[LessEqual[z, 2.52e+207]], $MachinePrecision]], t$95$0, N[(-6.0 * N[(x * z), $MachinePrecision]), $MachinePrecision]]]]]]]]]
\begin{array}{l}

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

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

\mathbf{elif}\;z \leq -1.05 \cdot 10^{+212}:\\
\;\;\;\;t_0\\

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

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

\mathbf{elif}\;z \leq 1.56 \cdot 10^{-15}:\\
\;\;\;\;x\\

\mathbf{elif}\;z \leq 1.8 \cdot 10^{+166} \lor \neg \left(z \leq 2.52 \cdot 10^{+207}\right):\\
\;\;\;\;t_0\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 6 regimes
  2. if z < -3.20000000000000022e247 or -4.19999999999999988e228 < z < -1.05e212 or 1.55999999999999991e-15 < z < 1.7999999999999999e166 or 2.51999999999999998e207 < z

    1. Initial program 99.7%

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(z, \color{blue}{\left(\left(-y\right) + \left(-\left(-x\right)\right)\right)} \cdot \left(-6\right), x\right) \]
      9. remove-double-neg99.7%

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

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

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

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

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

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

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

        \[\leadsto -6 \cdot \color{blue}{{\left(\sqrt{z \cdot \left(x - y\right)}\right)}^{2}} \]
    6. Applied egg-rr46.9%

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

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

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

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

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

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

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

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

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

    if -3.20000000000000022e247 < z < -4.19999999999999988e228

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(z, \color{blue}{\left(\left(-y\right) + \left(-\left(-x\right)\right)\right)} \cdot \left(-6\right), x\right) \]
      9. remove-double-neg99.8%

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

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

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

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

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

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

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

        \[\leadsto -6 \cdot \color{blue}{{\left(\sqrt{z \cdot \left(x - y\right)}\right)}^{2}} \]
    6. Applied egg-rr62.3%

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

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

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

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

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

    if -1.05e212 < z < -1.69999999999999992e99

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(z, \color{blue}{\left(\left(-y\right) + \left(-\left(-x\right)\right)\right)} \cdot \left(-6\right), x\right) \]
      9. remove-double-neg99.9%

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

        \[\leadsto \mathsf{fma}\left(z, \color{blue}{\left(x + \left(-y\right)\right)} \cdot \left(-6\right), x\right) \]
      11. sub-neg99.9%

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

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

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

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

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

        \[\leadsto -6 \cdot \color{blue}{{\left(\sqrt{z \cdot \left(x - y\right)}\right)}^{2}} \]
    6. Applied egg-rr37.4%

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

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

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

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

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

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

    if -1.69999999999999992e99 < z < -3.3e-20

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(z, \color{blue}{\left(\left(-y\right) + \left(-\left(-x\right)\right)\right)} \cdot \left(-6\right), x\right) \]
      9. remove-double-neg99.8%

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

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

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

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

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

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

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

        \[\leadsto -6 \cdot \color{blue}{{\left(\sqrt{z \cdot \left(x - y\right)}\right)}^{2}} \]
    6. Applied egg-rr53.9%

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{z \cdot \left(y \cdot 6\right)} \]
    12. Simplified61.5%

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

    if -3.3e-20 < z < 1.55999999999999991e-15

    1. Initial program 99.1%

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

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

    if 1.7999999999999999e166 < z < 2.51999999999999998e207

    1. Initial program 100.0%

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(z, -\color{blue}{\left(-\left(y - x\right)\right) \cdot 6}, x\right) \]
      6. distribute-rgt-neg-in100.0%

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

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

        \[\leadsto \mathsf{fma}\left(z, \color{blue}{\left(\left(-y\right) + \left(-\left(-x\right)\right)\right)} \cdot \left(-6\right), x\right) \]
      9. remove-double-neg100.0%

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

        \[\leadsto \mathsf{fma}\left(z, \color{blue}{\left(x + \left(-y\right)\right)} \cdot \left(-6\right), x\right) \]
      11. sub-neg100.0%

        \[\leadsto \mathsf{fma}\left(z, \color{blue}{\left(x - y\right)} \cdot \left(-6\right), x\right) \]
      12. metadata-eval100.0%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -3.2 \cdot 10^{+247}:\\ \;\;\;\;y \cdot \left(6 \cdot z\right)\\ \mathbf{elif}\;z \leq -4.2 \cdot 10^{+228}:\\ \;\;\;\;x \cdot \left(z \cdot -6\right)\\ \mathbf{elif}\;z \leq -1.05 \cdot 10^{+212}:\\ \;\;\;\;y \cdot \left(6 \cdot z\right)\\ \mathbf{elif}\;z \leq -1.7 \cdot 10^{+99}:\\ \;\;\;\;z \cdot \left(x \cdot -6\right)\\ \mathbf{elif}\;z \leq -3.3 \cdot 10^{-20}:\\ \;\;\;\;z \cdot \left(y \cdot 6\right)\\ \mathbf{elif}\;z \leq 1.56 \cdot 10^{-15}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 1.8 \cdot 10^{+166} \lor \neg \left(z \leq 2.52 \cdot 10^{+207}\right):\\ \;\;\;\;y \cdot \left(6 \cdot z\right)\\ \mathbf{else}:\\ \;\;\;\;-6 \cdot \left(x \cdot z\right)\\ \end{array} \]

Alternative 5: 61.2% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := y \cdot \left(6 \cdot z\right)\\ \mathbf{if}\;z \leq -2.4 \cdot 10^{+247}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;z \leq -8 \cdot 10^{+228}:\\ \;\;\;\;x \cdot \left(z \cdot -6\right)\\ \mathbf{elif}\;z \leq -3 \cdot 10^{+210}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;z \leq -9.2 \cdot 10^{+97}:\\ \;\;\;\;z \cdot \left(x \cdot -6\right)\\ \mathbf{elif}\;z \leq -7.5 \cdot 10^{-20}:\\ \;\;\;\;z \cdot \left(y \cdot 6\right)\\ \mathbf{elif}\;z \leq 3 \cdot 10^{-20}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 2.1 \cdot 10^{+166} \lor \neg \left(z \leq 7.6 \cdot 10^{+207}\right):\\ \;\;\;\;6 \cdot \left(y \cdot z\right)\\ \mathbf{else}:\\ \;\;\;\;-6 \cdot \left(x \cdot z\right)\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (let* ((t_0 (* y (* 6.0 z))))
   (if (<= z -2.4e+247)
     t_0
     (if (<= z -8e+228)
       (* x (* z -6.0))
       (if (<= z -3e+210)
         t_0
         (if (<= z -9.2e+97)
           (* z (* x -6.0))
           (if (<= z -7.5e-20)
             (* z (* y 6.0))
             (if (<= z 3e-20)
               x
               (if (or (<= z 2.1e+166) (not (<= z 7.6e+207)))
                 (* 6.0 (* y z))
                 (* -6.0 (* x z)))))))))))
double code(double x, double y, double z) {
	double t_0 = y * (6.0 * z);
	double tmp;
	if (z <= -2.4e+247) {
		tmp = t_0;
	} else if (z <= -8e+228) {
		tmp = x * (z * -6.0);
	} else if (z <= -3e+210) {
		tmp = t_0;
	} else if (z <= -9.2e+97) {
		tmp = z * (x * -6.0);
	} else if (z <= -7.5e-20) {
		tmp = z * (y * 6.0);
	} else if (z <= 3e-20) {
		tmp = x;
	} else if ((z <= 2.1e+166) || !(z <= 7.6e+207)) {
		tmp = 6.0 * (y * z);
	} else {
		tmp = -6.0 * (x * z);
	}
	return tmp;
}
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8) :: t_0
    real(8) :: tmp
    t_0 = y * (6.0d0 * z)
    if (z <= (-2.4d+247)) then
        tmp = t_0
    else if (z <= (-8d+228)) then
        tmp = x * (z * (-6.0d0))
    else if (z <= (-3d+210)) then
        tmp = t_0
    else if (z <= (-9.2d+97)) then
        tmp = z * (x * (-6.0d0))
    else if (z <= (-7.5d-20)) then
        tmp = z * (y * 6.0d0)
    else if (z <= 3d-20) then
        tmp = x
    else if ((z <= 2.1d+166) .or. (.not. (z <= 7.6d+207))) then
        tmp = 6.0d0 * (y * z)
    else
        tmp = (-6.0d0) * (x * z)
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double t_0 = y * (6.0 * z);
	double tmp;
	if (z <= -2.4e+247) {
		tmp = t_0;
	} else if (z <= -8e+228) {
		tmp = x * (z * -6.0);
	} else if (z <= -3e+210) {
		tmp = t_0;
	} else if (z <= -9.2e+97) {
		tmp = z * (x * -6.0);
	} else if (z <= -7.5e-20) {
		tmp = z * (y * 6.0);
	} else if (z <= 3e-20) {
		tmp = x;
	} else if ((z <= 2.1e+166) || !(z <= 7.6e+207)) {
		tmp = 6.0 * (y * z);
	} else {
		tmp = -6.0 * (x * z);
	}
	return tmp;
}
def code(x, y, z):
	t_0 = y * (6.0 * z)
	tmp = 0
	if z <= -2.4e+247:
		tmp = t_0
	elif z <= -8e+228:
		tmp = x * (z * -6.0)
	elif z <= -3e+210:
		tmp = t_0
	elif z <= -9.2e+97:
		tmp = z * (x * -6.0)
	elif z <= -7.5e-20:
		tmp = z * (y * 6.0)
	elif z <= 3e-20:
		tmp = x
	elif (z <= 2.1e+166) or not (z <= 7.6e+207):
		tmp = 6.0 * (y * z)
	else:
		tmp = -6.0 * (x * z)
	return tmp
function code(x, y, z)
	t_0 = Float64(y * Float64(6.0 * z))
	tmp = 0.0
	if (z <= -2.4e+247)
		tmp = t_0;
	elseif (z <= -8e+228)
		tmp = Float64(x * Float64(z * -6.0));
	elseif (z <= -3e+210)
		tmp = t_0;
	elseif (z <= -9.2e+97)
		tmp = Float64(z * Float64(x * -6.0));
	elseif (z <= -7.5e-20)
		tmp = Float64(z * Float64(y * 6.0));
	elseif (z <= 3e-20)
		tmp = x;
	elseif ((z <= 2.1e+166) || !(z <= 7.6e+207))
		tmp = Float64(6.0 * Float64(y * z));
	else
		tmp = Float64(-6.0 * Float64(x * z));
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	t_0 = y * (6.0 * z);
	tmp = 0.0;
	if (z <= -2.4e+247)
		tmp = t_0;
	elseif (z <= -8e+228)
		tmp = x * (z * -6.0);
	elseif (z <= -3e+210)
		tmp = t_0;
	elseif (z <= -9.2e+97)
		tmp = z * (x * -6.0);
	elseif (z <= -7.5e-20)
		tmp = z * (y * 6.0);
	elseif (z <= 3e-20)
		tmp = x;
	elseif ((z <= 2.1e+166) || ~((z <= 7.6e+207)))
		tmp = 6.0 * (y * z);
	else
		tmp = -6.0 * (x * z);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := Block[{t$95$0 = N[(y * N[(6.0 * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2.4e+247], t$95$0, If[LessEqual[z, -8e+228], N[(x * N[(z * -6.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -3e+210], t$95$0, If[LessEqual[z, -9.2e+97], N[(z * N[(x * -6.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -7.5e-20], N[(z * N[(y * 6.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3e-20], x, If[Or[LessEqual[z, 2.1e+166], N[Not[LessEqual[z, 7.6e+207]], $MachinePrecision]], N[(6.0 * N[(y * z), $MachinePrecision]), $MachinePrecision], N[(-6.0 * N[(x * z), $MachinePrecision]), $MachinePrecision]]]]]]]]]
\begin{array}{l}

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

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

\mathbf{elif}\;z \leq -3 \cdot 10^{+210}:\\
\;\;\;\;t_0\\

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

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

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

\mathbf{elif}\;z \leq 2.1 \cdot 10^{+166} \lor \neg \left(z \leq 7.6 \cdot 10^{+207}\right):\\
\;\;\;\;6 \cdot \left(y \cdot z\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 7 regimes
  2. if z < -2.4e247 or -7.9999999999999994e228 < z < -3.00000000000000022e210

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(z, \color{blue}{\left(\left(-y\right) + \left(-\left(-x\right)\right)\right)} \cdot \left(-6\right), x\right) \]
      9. remove-double-neg99.8%

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

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

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

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

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

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

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

        \[\leadsto -6 \cdot \color{blue}{{\left(\sqrt{z \cdot \left(x - y\right)}\right)}^{2}} \]
    6. Applied egg-rr49.9%

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

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

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

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

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

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

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

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

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

    if -2.4e247 < z < -7.9999999999999994e228

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(z, \color{blue}{\left(\left(-y\right) + \left(-\left(-x\right)\right)\right)} \cdot \left(-6\right), x\right) \]
      9. remove-double-neg99.8%

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

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

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

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

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

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

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

        \[\leadsto -6 \cdot \color{blue}{{\left(\sqrt{z \cdot \left(x - y\right)}\right)}^{2}} \]
    6. Applied egg-rr62.3%

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

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

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

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

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

    if -3.00000000000000022e210 < z < -9.20000000000000022e97

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(z, \color{blue}{\left(\left(-y\right) + \left(-\left(-x\right)\right)\right)} \cdot \left(-6\right), x\right) \]
      9. remove-double-neg99.9%

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

        \[\leadsto \mathsf{fma}\left(z, \color{blue}{\left(x + \left(-y\right)\right)} \cdot \left(-6\right), x\right) \]
      11. sub-neg99.9%

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

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

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

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

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

        \[\leadsto -6 \cdot \color{blue}{{\left(\sqrt{z \cdot \left(x - y\right)}\right)}^{2}} \]
    6. Applied egg-rr37.4%

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

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

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

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

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

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

    if -9.20000000000000022e97 < z < -7.49999999999999981e-20

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(z, \color{blue}{\left(\left(-y\right) + \left(-\left(-x\right)\right)\right)} \cdot \left(-6\right), x\right) \]
      9. remove-double-neg99.8%

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

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

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

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

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

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

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

        \[\leadsto -6 \cdot \color{blue}{{\left(\sqrt{z \cdot \left(x - y\right)}\right)}^{2}} \]
    6. Applied egg-rr53.9%

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{z \cdot \left(y \cdot 6\right)} \]
    12. Simplified61.5%

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

    if -7.49999999999999981e-20 < z < 3.00000000000000029e-20

    1. Initial program 99.1%

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

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

    if 3.00000000000000029e-20 < z < 2.1000000000000001e166 or 7.59999999999999973e207 < z

    1. Initial program 99.7%

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(z, \color{blue}{\left(\left(-y\right) + \left(-\left(-x\right)\right)\right)} \cdot \left(-6\right), x\right) \]
      9. remove-double-neg99.7%

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

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

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

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

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

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

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

        \[\leadsto -6 \cdot \color{blue}{{\left(\sqrt{z \cdot \left(x - y\right)}\right)}^{2}} \]
    6. Applied egg-rr46.1%

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

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

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

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

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

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

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

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

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

    if 2.1000000000000001e166 < z < 7.59999999999999973e207

    1. Initial program 100.0%

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(z, -\color{blue}{\left(-\left(y - x\right)\right) \cdot 6}, x\right) \]
      6. distribute-rgt-neg-in100.0%

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

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

        \[\leadsto \mathsf{fma}\left(z, \color{blue}{\left(\left(-y\right) + \left(-\left(-x\right)\right)\right)} \cdot \left(-6\right), x\right) \]
      9. remove-double-neg100.0%

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

        \[\leadsto \mathsf{fma}\left(z, \color{blue}{\left(x + \left(-y\right)\right)} \cdot \left(-6\right), x\right) \]
      11. sub-neg100.0%

        \[\leadsto \mathsf{fma}\left(z, \color{blue}{\left(x - y\right)} \cdot \left(-6\right), x\right) \]
      12. metadata-eval100.0%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -2.4 \cdot 10^{+247}:\\ \;\;\;\;y \cdot \left(6 \cdot z\right)\\ \mathbf{elif}\;z \leq -8 \cdot 10^{+228}:\\ \;\;\;\;x \cdot \left(z \cdot -6\right)\\ \mathbf{elif}\;z \leq -3 \cdot 10^{+210}:\\ \;\;\;\;y \cdot \left(6 \cdot z\right)\\ \mathbf{elif}\;z \leq -9.2 \cdot 10^{+97}:\\ \;\;\;\;z \cdot \left(x \cdot -6\right)\\ \mathbf{elif}\;z \leq -7.5 \cdot 10^{-20}:\\ \;\;\;\;z \cdot \left(y \cdot 6\right)\\ \mathbf{elif}\;z \leq 3 \cdot 10^{-20}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 2.1 \cdot 10^{+166} \lor \neg \left(z \leq 7.6 \cdot 10^{+207}\right):\\ \;\;\;\;6 \cdot \left(y \cdot z\right)\\ \mathbf{else}:\\ \;\;\;\;-6 \cdot \left(x \cdot z\right)\\ \end{array} \]

Alternative 6: 84.7% accurate, 0.8× speedup?

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

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

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


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

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(z, \color{blue}{\left(\left(-y\right) + \left(-\left(-x\right)\right)\right)} \cdot \left(-6\right), x\right) \]
      9. remove-double-neg99.8%

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

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

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

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

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

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

    if -3.3e-20 < z < 9.2000000000000004e-18

    1. Initial program 99.1%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -3.3 \cdot 10^{-20} \lor \neg \left(z \leq 9.2 \cdot 10^{-18}\right):\\ \;\;\;\;-6 \cdot \left(z \cdot \left(x - y\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]

Alternative 7: 84.8% accurate, 0.8× speedup?

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

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

\mathbf{elif}\;z \leq 4.3 \cdot 10^{-17}:\\
\;\;\;\;x\\

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


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

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(z, \color{blue}{\left(\left(-y\right) + \left(-\left(-x\right)\right)\right)} \cdot \left(-6\right), x\right) \]
      9. remove-double-neg99.8%

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

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

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

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

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

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

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

        \[\leadsto -6 \cdot \color{blue}{{\left(\sqrt{z \cdot \left(x - y\right)}\right)}^{2}} \]
    6. Applied egg-rr48.3%

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

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

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

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

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

    if -1.15e-20 < z < 4.30000000000000023e-17

    1. Initial program 99.1%

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

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

    if 4.30000000000000023e-17 < z

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(z, \color{blue}{\left(\left(-y\right) + \left(-\left(-x\right)\right)\right)} \cdot \left(-6\right), x\right) \]
      9. remove-double-neg99.8%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.15 \cdot 10^{-20}:\\ \;\;\;\;\left(z \cdot -6\right) \cdot \left(x - y\right)\\ \mathbf{elif}\;z \leq 4.3 \cdot 10^{-17}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;-6 \cdot \left(z \cdot \left(x - y\right)\right)\\ \end{array} \]

Alternative 8: 98.7% accurate, 0.8× speedup?

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

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

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

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


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

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(z, \color{blue}{\left(\left(-y\right) + \left(-\left(-x\right)\right)\right)} \cdot \left(-6\right), x\right) \]
      9. remove-double-neg99.8%

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

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

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

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

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

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

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

        \[\leadsto -6 \cdot \color{blue}{{\left(\sqrt{z \cdot \left(x - y\right)}\right)}^{2}} \]
    6. Applied egg-rr48.3%

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

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

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

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

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

    if -0.116000000000000006 < z < 0.170000000000000012

    1. Initial program 99.2%

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

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

    if 0.170000000000000012 < z

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(z, \color{blue}{\left(\left(-y\right) + \left(-\left(-x\right)\right)\right)} \cdot \left(-6\right), x\right) \]
      9. remove-double-neg99.8%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -0.116:\\ \;\;\;\;\left(z \cdot -6\right) \cdot \left(x - y\right)\\ \mathbf{elif}\;z \leq 0.17:\\ \;\;\;\;x + 6 \cdot \left(y \cdot z\right)\\ \mathbf{else}:\\ \;\;\;\;-6 \cdot \left(z \cdot \left(x - y\right)\right)\\ \end{array} \]

Alternative 9: 61.0% accurate, 1.0× speedup?

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

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

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


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

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(z, \color{blue}{\left(\left(-y\right) + \left(-\left(-x\right)\right)\right)} \cdot \left(-6\right), x\right) \]
      9. remove-double-neg99.8%

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

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

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

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

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

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

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

    if -2.24999999999999988e-9 < z < 62000

    1. Initial program 99.1%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -2.25 \cdot 10^{-9} \lor \neg \left(z \leq 62000\right):\\ \;\;\;\;-6 \cdot \left(x \cdot z\right)\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]

Alternative 10: 99.7% accurate, 1.0× speedup?

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

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

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

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

Alternative 11: 36.7% accurate, 9.0× speedup?

\[\begin{array}{l} \\ x \end{array} \]
(FPCore (x y z) :precision binary64 x)
double code(double x, double y, double z) {
	return x;
}
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    code = x
end function
public static double code(double x, double y, double z) {
	return x;
}
def code(x, y, z):
	return x
function code(x, y, z)
	return x
end
function tmp = code(x, y, z)
	tmp = x;
end
code[x_, y_, z_] := x
\begin{array}{l}

\\
x
\end{array}
Derivation
  1. Initial program 99.5%

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

    \[\leadsto \color{blue}{x} \]
  3. Final simplification37.9%

    \[\leadsto x \]

Developer target: 99.8% accurate, 1.0× speedup?

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

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

Reproduce

?
herbie shell --seed 2023335 
(FPCore (x y z)
  :name "Data.Colour.RGBSpace.HSL:hsl from colour-2.3.3, E"
  :precision binary64

  :herbie-target
  (- x (* (* 6.0 z) (- x y)))

  (+ x (* (* (- y x) 6.0) z)))