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

Percentage Accurate: 99.5% → 99.7%
Time: 12.3s
Alternatives: 15
Speedup: 1.2×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 15 alternatives:

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

Initial Program: 99.5% accurate, 1.0× speedup?

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

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

Alternative 1: 99.7% accurate, 0.9× speedup?

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

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

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

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

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

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

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

Alternative 2: 49.7% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := -6 \cdot \left(z \cdot y\right)\\ t_1 := x \cdot \left(z \cdot 6\right)\\ \mathbf{if}\;z \leq -1.8 \cdot 10^{+234}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;z \leq -4.6 \cdot 10^{+85}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq -0.66:\\ \;\;\;\;t_0\\ \mathbf{elif}\;z \leq -2.5 \cdot 10^{-126}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq -4.5 \cdot 10^{-148}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq -1.5 \cdot 10^{-203}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq -4.8 \cdot 10^{-242}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 1.32 \cdot 10^{-256}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 1.35 \cdot 10^{-152}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 0.68:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 6.2 \cdot 10^{+20}:\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (let* ((t_0 (* -6.0 (* z y))) (t_1 (* x (* z 6.0))))
   (if (<= z -1.8e+234)
     t_0
     (if (<= z -4.6e+85)
       t_1
       (if (<= z -0.66)
         t_0
         (if (<= z -2.5e-126)
           (* y 4.0)
           (if (<= z -4.5e-148)
             (* x -3.0)
             (if (<= z -1.5e-203)
               (* y 4.0)
               (if (<= z -4.8e-242)
                 (* x -3.0)
                 (if (<= z 1.32e-256)
                   (* y 4.0)
                   (if (<= z 1.35e-152)
                     (* x -3.0)
                     (if (<= z 0.68)
                       (* y 4.0)
                       (if (<= z 6.2e+20) t_0 t_1)))))))))))))
double code(double x, double y, double z) {
	double t_0 = -6.0 * (z * y);
	double t_1 = x * (z * 6.0);
	double tmp;
	if (z <= -1.8e+234) {
		tmp = t_0;
	} else if (z <= -4.6e+85) {
		tmp = t_1;
	} else if (z <= -0.66) {
		tmp = t_0;
	} else if (z <= -2.5e-126) {
		tmp = y * 4.0;
	} else if (z <= -4.5e-148) {
		tmp = x * -3.0;
	} else if (z <= -1.5e-203) {
		tmp = y * 4.0;
	} else if (z <= -4.8e-242) {
		tmp = x * -3.0;
	} else if (z <= 1.32e-256) {
		tmp = y * 4.0;
	} else if (z <= 1.35e-152) {
		tmp = x * -3.0;
	} else if (z <= 0.68) {
		tmp = y * 4.0;
	} else if (z <= 6.2e+20) {
		tmp = t_0;
	} else {
		tmp = t_1;
	}
	return tmp;
}
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8) :: t_0
    real(8) :: t_1
    real(8) :: tmp
    t_0 = (-6.0d0) * (z * y)
    t_1 = x * (z * 6.0d0)
    if (z <= (-1.8d+234)) then
        tmp = t_0
    else if (z <= (-4.6d+85)) then
        tmp = t_1
    else if (z <= (-0.66d0)) then
        tmp = t_0
    else if (z <= (-2.5d-126)) then
        tmp = y * 4.0d0
    else if (z <= (-4.5d-148)) then
        tmp = x * (-3.0d0)
    else if (z <= (-1.5d-203)) then
        tmp = y * 4.0d0
    else if (z <= (-4.8d-242)) then
        tmp = x * (-3.0d0)
    else if (z <= 1.32d-256) then
        tmp = y * 4.0d0
    else if (z <= 1.35d-152) then
        tmp = x * (-3.0d0)
    else if (z <= 0.68d0) then
        tmp = y * 4.0d0
    else if (z <= 6.2d+20) then
        tmp = t_0
    else
        tmp = t_1
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double t_0 = -6.0 * (z * y);
	double t_1 = x * (z * 6.0);
	double tmp;
	if (z <= -1.8e+234) {
		tmp = t_0;
	} else if (z <= -4.6e+85) {
		tmp = t_1;
	} else if (z <= -0.66) {
		tmp = t_0;
	} else if (z <= -2.5e-126) {
		tmp = y * 4.0;
	} else if (z <= -4.5e-148) {
		tmp = x * -3.0;
	} else if (z <= -1.5e-203) {
		tmp = y * 4.0;
	} else if (z <= -4.8e-242) {
		tmp = x * -3.0;
	} else if (z <= 1.32e-256) {
		tmp = y * 4.0;
	} else if (z <= 1.35e-152) {
		tmp = x * -3.0;
	} else if (z <= 0.68) {
		tmp = y * 4.0;
	} else if (z <= 6.2e+20) {
		tmp = t_0;
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z):
	t_0 = -6.0 * (z * y)
	t_1 = x * (z * 6.0)
	tmp = 0
	if z <= -1.8e+234:
		tmp = t_0
	elif z <= -4.6e+85:
		tmp = t_1
	elif z <= -0.66:
		tmp = t_0
	elif z <= -2.5e-126:
		tmp = y * 4.0
	elif z <= -4.5e-148:
		tmp = x * -3.0
	elif z <= -1.5e-203:
		tmp = y * 4.0
	elif z <= -4.8e-242:
		tmp = x * -3.0
	elif z <= 1.32e-256:
		tmp = y * 4.0
	elif z <= 1.35e-152:
		tmp = x * -3.0
	elif z <= 0.68:
		tmp = y * 4.0
	elif z <= 6.2e+20:
		tmp = t_0
	else:
		tmp = t_1
	return tmp
function code(x, y, z)
	t_0 = Float64(-6.0 * Float64(z * y))
	t_1 = Float64(x * Float64(z * 6.0))
	tmp = 0.0
	if (z <= -1.8e+234)
		tmp = t_0;
	elseif (z <= -4.6e+85)
		tmp = t_1;
	elseif (z <= -0.66)
		tmp = t_0;
	elseif (z <= -2.5e-126)
		tmp = Float64(y * 4.0);
	elseif (z <= -4.5e-148)
		tmp = Float64(x * -3.0);
	elseif (z <= -1.5e-203)
		tmp = Float64(y * 4.0);
	elseif (z <= -4.8e-242)
		tmp = Float64(x * -3.0);
	elseif (z <= 1.32e-256)
		tmp = Float64(y * 4.0);
	elseif (z <= 1.35e-152)
		tmp = Float64(x * -3.0);
	elseif (z <= 0.68)
		tmp = Float64(y * 4.0);
	elseif (z <= 6.2e+20)
		tmp = t_0;
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	t_0 = -6.0 * (z * y);
	t_1 = x * (z * 6.0);
	tmp = 0.0;
	if (z <= -1.8e+234)
		tmp = t_0;
	elseif (z <= -4.6e+85)
		tmp = t_1;
	elseif (z <= -0.66)
		tmp = t_0;
	elseif (z <= -2.5e-126)
		tmp = y * 4.0;
	elseif (z <= -4.5e-148)
		tmp = x * -3.0;
	elseif (z <= -1.5e-203)
		tmp = y * 4.0;
	elseif (z <= -4.8e-242)
		tmp = x * -3.0;
	elseif (z <= 1.32e-256)
		tmp = y * 4.0;
	elseif (z <= 1.35e-152)
		tmp = x * -3.0;
	elseif (z <= 0.68)
		tmp = y * 4.0;
	elseif (z <= 6.2e+20)
		tmp = t_0;
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := Block[{t$95$0 = N[(-6.0 * N[(z * y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x * N[(z * 6.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.8e+234], t$95$0, If[LessEqual[z, -4.6e+85], t$95$1, If[LessEqual[z, -0.66], t$95$0, If[LessEqual[z, -2.5e-126], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, -4.5e-148], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, -1.5e-203], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, -4.8e-242], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 1.32e-256], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 1.35e-152], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 0.68], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 6.2e+20], t$95$0, t$95$1]]]]]]]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;z \leq -4.6 \cdot 10^{+85}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;z \leq -0.66:\\
\;\;\;\;t_0\\

\mathbf{elif}\;z \leq -2.5 \cdot 10^{-126}:\\
\;\;\;\;y \cdot 4\\

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

\mathbf{elif}\;z \leq -1.5 \cdot 10^{-203}:\\
\;\;\;\;y \cdot 4\\

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

\mathbf{elif}\;z \leq 1.32 \cdot 10^{-256}:\\
\;\;\;\;y \cdot 4\\

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

\mathbf{elif}\;z \leq 0.68:\\
\;\;\;\;y \cdot 4\\

\mathbf{elif}\;z \leq 6.2 \cdot 10^{+20}:\\
\;\;\;\;t_0\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -1.8e234 or -4.5999999999999998e85 < z < -0.660000000000000031 or 0.680000000000000049 < z < 6.2e20

    1. Initial program 99.7%

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

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

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

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

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

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

    if -1.8e234 < z < -4.5999999999999998e85 or 6.2e20 < z

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

    if -0.660000000000000031 < z < -2.50000000000000003e-126 or -4.50000000000000015e-148 < z < -1.5000000000000001e-203 or -4.8000000000000002e-242 < z < 1.32e-256 or 1.34999999999999999e-152 < z < 0.680000000000000049

    1. Initial program 99.3%

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

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

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

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

      \[\leadsto \color{blue}{4 \cdot y} \]
    6. Step-by-step derivation
      1. *-commutative64.3%

        \[\leadsto \color{blue}{y \cdot 4} \]
    7. Simplified64.3%

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

    if -2.50000000000000003e-126 < z < -4.50000000000000015e-148 or -1.5000000000000001e-203 < z < -4.8000000000000002e-242 or 1.32e-256 < z < 1.34999999999999999e-152

    1. Initial program 99.4%

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

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

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

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

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

        \[\leadsto \color{blue}{x \cdot -3} \]
    7. Simplified81.5%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.8 \cdot 10^{+234}:\\ \;\;\;\;-6 \cdot \left(z \cdot y\right)\\ \mathbf{elif}\;z \leq -4.6 \cdot 10^{+85}:\\ \;\;\;\;x \cdot \left(z \cdot 6\right)\\ \mathbf{elif}\;z \leq -0.66:\\ \;\;\;\;-6 \cdot \left(z \cdot y\right)\\ \mathbf{elif}\;z \leq -2.5 \cdot 10^{-126}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq -4.5 \cdot 10^{-148}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq -1.5 \cdot 10^{-203}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq -4.8 \cdot 10^{-242}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 1.32 \cdot 10^{-256}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 1.35 \cdot 10^{-152}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 0.68:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 6.2 \cdot 10^{+20}:\\ \;\;\;\;-6 \cdot \left(z \cdot y\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(z \cdot 6\right)\\ \end{array} \]

Alternative 3: 49.7% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := -6 \cdot \left(z \cdot y\right)\\ t_1 := x \cdot \left(z \cdot 6\right)\\ \mathbf{if}\;z \leq -4.2 \cdot 10^{+234}:\\ \;\;\;\;z \cdot \left(-6 \cdot y\right)\\ \mathbf{elif}\;z \leq -1.95 \cdot 10^{+86}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq -0.66:\\ \;\;\;\;t_0\\ \mathbf{elif}\;z \leq -1 \cdot 10^{-127}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq -5 \cdot 10^{-148}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq -9.5 \cdot 10^{-199}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq -5.6 \cdot 10^{-243}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 4.2 \cdot 10^{-257}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 5.2 \cdot 10^{-150}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 0.68:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 5.7 \cdot 10^{+20}:\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (let* ((t_0 (* -6.0 (* z y))) (t_1 (* x (* z 6.0))))
   (if (<= z -4.2e+234)
     (* z (* -6.0 y))
     (if (<= z -1.95e+86)
       t_1
       (if (<= z -0.66)
         t_0
         (if (<= z -1e-127)
           (* y 4.0)
           (if (<= z -5e-148)
             (* x -3.0)
             (if (<= z -9.5e-199)
               (* y 4.0)
               (if (<= z -5.6e-243)
                 (* x -3.0)
                 (if (<= z 4.2e-257)
                   (* y 4.0)
                   (if (<= z 5.2e-150)
                     (* x -3.0)
                     (if (<= z 0.68)
                       (* y 4.0)
                       (if (<= z 5.7e+20) t_0 t_1)))))))))))))
double code(double x, double y, double z) {
	double t_0 = -6.0 * (z * y);
	double t_1 = x * (z * 6.0);
	double tmp;
	if (z <= -4.2e+234) {
		tmp = z * (-6.0 * y);
	} else if (z <= -1.95e+86) {
		tmp = t_1;
	} else if (z <= -0.66) {
		tmp = t_0;
	} else if (z <= -1e-127) {
		tmp = y * 4.0;
	} else if (z <= -5e-148) {
		tmp = x * -3.0;
	} else if (z <= -9.5e-199) {
		tmp = y * 4.0;
	} else if (z <= -5.6e-243) {
		tmp = x * -3.0;
	} else if (z <= 4.2e-257) {
		tmp = y * 4.0;
	} else if (z <= 5.2e-150) {
		tmp = x * -3.0;
	} else if (z <= 0.68) {
		tmp = y * 4.0;
	} else if (z <= 5.7e+20) {
		tmp = t_0;
	} else {
		tmp = t_1;
	}
	return tmp;
}
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8) :: t_0
    real(8) :: t_1
    real(8) :: tmp
    t_0 = (-6.0d0) * (z * y)
    t_1 = x * (z * 6.0d0)
    if (z <= (-4.2d+234)) then
        tmp = z * ((-6.0d0) * y)
    else if (z <= (-1.95d+86)) then
        tmp = t_1
    else if (z <= (-0.66d0)) then
        tmp = t_0
    else if (z <= (-1d-127)) then
        tmp = y * 4.0d0
    else if (z <= (-5d-148)) then
        tmp = x * (-3.0d0)
    else if (z <= (-9.5d-199)) then
        tmp = y * 4.0d0
    else if (z <= (-5.6d-243)) then
        tmp = x * (-3.0d0)
    else if (z <= 4.2d-257) then
        tmp = y * 4.0d0
    else if (z <= 5.2d-150) then
        tmp = x * (-3.0d0)
    else if (z <= 0.68d0) then
        tmp = y * 4.0d0
    else if (z <= 5.7d+20) then
        tmp = t_0
    else
        tmp = t_1
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double t_0 = -6.0 * (z * y);
	double t_1 = x * (z * 6.0);
	double tmp;
	if (z <= -4.2e+234) {
		tmp = z * (-6.0 * y);
	} else if (z <= -1.95e+86) {
		tmp = t_1;
	} else if (z <= -0.66) {
		tmp = t_0;
	} else if (z <= -1e-127) {
		tmp = y * 4.0;
	} else if (z <= -5e-148) {
		tmp = x * -3.0;
	} else if (z <= -9.5e-199) {
		tmp = y * 4.0;
	} else if (z <= -5.6e-243) {
		tmp = x * -3.0;
	} else if (z <= 4.2e-257) {
		tmp = y * 4.0;
	} else if (z <= 5.2e-150) {
		tmp = x * -3.0;
	} else if (z <= 0.68) {
		tmp = y * 4.0;
	} else if (z <= 5.7e+20) {
		tmp = t_0;
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z):
	t_0 = -6.0 * (z * y)
	t_1 = x * (z * 6.0)
	tmp = 0
	if z <= -4.2e+234:
		tmp = z * (-6.0 * y)
	elif z <= -1.95e+86:
		tmp = t_1
	elif z <= -0.66:
		tmp = t_0
	elif z <= -1e-127:
		tmp = y * 4.0
	elif z <= -5e-148:
		tmp = x * -3.0
	elif z <= -9.5e-199:
		tmp = y * 4.0
	elif z <= -5.6e-243:
		tmp = x * -3.0
	elif z <= 4.2e-257:
		tmp = y * 4.0
	elif z <= 5.2e-150:
		tmp = x * -3.0
	elif z <= 0.68:
		tmp = y * 4.0
	elif z <= 5.7e+20:
		tmp = t_0
	else:
		tmp = t_1
	return tmp
function code(x, y, z)
	t_0 = Float64(-6.0 * Float64(z * y))
	t_1 = Float64(x * Float64(z * 6.0))
	tmp = 0.0
	if (z <= -4.2e+234)
		tmp = Float64(z * Float64(-6.0 * y));
	elseif (z <= -1.95e+86)
		tmp = t_1;
	elseif (z <= -0.66)
		tmp = t_0;
	elseif (z <= -1e-127)
		tmp = Float64(y * 4.0);
	elseif (z <= -5e-148)
		tmp = Float64(x * -3.0);
	elseif (z <= -9.5e-199)
		tmp = Float64(y * 4.0);
	elseif (z <= -5.6e-243)
		tmp = Float64(x * -3.0);
	elseif (z <= 4.2e-257)
		tmp = Float64(y * 4.0);
	elseif (z <= 5.2e-150)
		tmp = Float64(x * -3.0);
	elseif (z <= 0.68)
		tmp = Float64(y * 4.0);
	elseif (z <= 5.7e+20)
		tmp = t_0;
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	t_0 = -6.0 * (z * y);
	t_1 = x * (z * 6.0);
	tmp = 0.0;
	if (z <= -4.2e+234)
		tmp = z * (-6.0 * y);
	elseif (z <= -1.95e+86)
		tmp = t_1;
	elseif (z <= -0.66)
		tmp = t_0;
	elseif (z <= -1e-127)
		tmp = y * 4.0;
	elseif (z <= -5e-148)
		tmp = x * -3.0;
	elseif (z <= -9.5e-199)
		tmp = y * 4.0;
	elseif (z <= -5.6e-243)
		tmp = x * -3.0;
	elseif (z <= 4.2e-257)
		tmp = y * 4.0;
	elseif (z <= 5.2e-150)
		tmp = x * -3.0;
	elseif (z <= 0.68)
		tmp = y * 4.0;
	elseif (z <= 5.7e+20)
		tmp = t_0;
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := Block[{t$95$0 = N[(-6.0 * N[(z * y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x * N[(z * 6.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -4.2e+234], N[(z * N[(-6.0 * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -1.95e+86], t$95$1, If[LessEqual[z, -0.66], t$95$0, If[LessEqual[z, -1e-127], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, -5e-148], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, -9.5e-199], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, -5.6e-243], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 4.2e-257], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 5.2e-150], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 0.68], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 5.7e+20], t$95$0, t$95$1]]]]]]]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;z \leq -1.95 \cdot 10^{+86}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;z \leq -0.66:\\
\;\;\;\;t_0\\

\mathbf{elif}\;z \leq -1 \cdot 10^{-127}:\\
\;\;\;\;y \cdot 4\\

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

\mathbf{elif}\;z \leq -9.5 \cdot 10^{-199}:\\
\;\;\;\;y \cdot 4\\

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

\mathbf{elif}\;z \leq 4.2 \cdot 10^{-257}:\\
\;\;\;\;y \cdot 4\\

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

\mathbf{elif}\;z \leq 0.68:\\
\;\;\;\;y \cdot 4\\

\mathbf{elif}\;z \leq 5.7 \cdot 10^{+20}:\\
\;\;\;\;t_0\\

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


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

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

    if -4.2e234 < z < -1.9500000000000001e86 or 5.7e20 < z

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

    if -1.9500000000000001e86 < z < -0.660000000000000031 or 0.680000000000000049 < z < 5.7e20

    1. Initial program 99.6%

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

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

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

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

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

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

    if -0.660000000000000031 < z < -1e-127 or -4.9999999999999999e-148 < z < -9.5000000000000005e-199 or -5.59999999999999987e-243 < z < 4.2000000000000002e-257 or 5.1999999999999995e-150 < z < 0.680000000000000049

    1. Initial program 99.3%

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

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

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

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

      \[\leadsto \color{blue}{4 \cdot y} \]
    6. Step-by-step derivation
      1. *-commutative64.3%

        \[\leadsto \color{blue}{y \cdot 4} \]
    7. Simplified64.3%

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

    if -1e-127 < z < -4.9999999999999999e-148 or -9.5000000000000005e-199 < z < -5.59999999999999987e-243 or 4.2000000000000002e-257 < z < 5.1999999999999995e-150

    1. Initial program 99.4%

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

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

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

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

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

        \[\leadsto \color{blue}{x \cdot -3} \]
    7. Simplified81.5%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -4.2 \cdot 10^{+234}:\\ \;\;\;\;z \cdot \left(-6 \cdot y\right)\\ \mathbf{elif}\;z \leq -1.95 \cdot 10^{+86}:\\ \;\;\;\;x \cdot \left(z \cdot 6\right)\\ \mathbf{elif}\;z \leq -0.66:\\ \;\;\;\;-6 \cdot \left(z \cdot y\right)\\ \mathbf{elif}\;z \leq -1 \cdot 10^{-127}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq -5 \cdot 10^{-148}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq -9.5 \cdot 10^{-199}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq -5.6 \cdot 10^{-243}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 4.2 \cdot 10^{-257}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 5.2 \cdot 10^{-150}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 0.68:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 5.7 \cdot 10^{+20}:\\ \;\;\;\;-6 \cdot \left(z \cdot y\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(z \cdot 6\right)\\ \end{array} \]

Alternative 4: 72.6% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := -6 \cdot \left(z \cdot \left(y - x\right)\right)\\ \mathbf{if}\;z \leq -0.0126:\\ \;\;\;\;t_0\\ \mathbf{elif}\;z \leq -5.5 \cdot 10^{-126}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq -5 \cdot 10^{-148}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq -9 \cdot 10^{-203}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq -7.8 \cdot 10^{-241}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 4.5 \cdot 10^{-257}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 1.3 \cdot 10^{-151}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 3.3 \cdot 10^{-39}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 6400:\\ \;\;\;\;x \cdot \left(z \cdot 6 - 3\right)\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (let* ((t_0 (* -6.0 (* z (- y x)))))
   (if (<= z -0.0126)
     t_0
     (if (<= z -5.5e-126)
       (* y 4.0)
       (if (<= z -5e-148)
         (* x -3.0)
         (if (<= z -9e-203)
           (* y 4.0)
           (if (<= z -7.8e-241)
             (* x -3.0)
             (if (<= z 4.5e-257)
               (* y 4.0)
               (if (<= z 1.3e-151)
                 (* x -3.0)
                 (if (<= z 3.3e-39)
                   (* y 4.0)
                   (if (<= z 6400.0) (* x (- (* z 6.0) 3.0)) t_0)))))))))))
double code(double x, double y, double z) {
	double t_0 = -6.0 * (z * (y - x));
	double tmp;
	if (z <= -0.0126) {
		tmp = t_0;
	} else if (z <= -5.5e-126) {
		tmp = y * 4.0;
	} else if (z <= -5e-148) {
		tmp = x * -3.0;
	} else if (z <= -9e-203) {
		tmp = y * 4.0;
	} else if (z <= -7.8e-241) {
		tmp = x * -3.0;
	} else if (z <= 4.5e-257) {
		tmp = y * 4.0;
	} else if (z <= 1.3e-151) {
		tmp = x * -3.0;
	} else if (z <= 3.3e-39) {
		tmp = y * 4.0;
	} else if (z <= 6400.0) {
		tmp = x * ((z * 6.0) - 3.0);
	} else {
		tmp = t_0;
	}
	return tmp;
}
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8) :: t_0
    real(8) :: tmp
    t_0 = (-6.0d0) * (z * (y - x))
    if (z <= (-0.0126d0)) then
        tmp = t_0
    else if (z <= (-5.5d-126)) then
        tmp = y * 4.0d0
    else if (z <= (-5d-148)) then
        tmp = x * (-3.0d0)
    else if (z <= (-9d-203)) then
        tmp = y * 4.0d0
    else if (z <= (-7.8d-241)) then
        tmp = x * (-3.0d0)
    else if (z <= 4.5d-257) then
        tmp = y * 4.0d0
    else if (z <= 1.3d-151) then
        tmp = x * (-3.0d0)
    else if (z <= 3.3d-39) then
        tmp = y * 4.0d0
    else if (z <= 6400.0d0) then
        tmp = x * ((z * 6.0d0) - 3.0d0)
    else
        tmp = t_0
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double t_0 = -6.0 * (z * (y - x));
	double tmp;
	if (z <= -0.0126) {
		tmp = t_0;
	} else if (z <= -5.5e-126) {
		tmp = y * 4.0;
	} else if (z <= -5e-148) {
		tmp = x * -3.0;
	} else if (z <= -9e-203) {
		tmp = y * 4.0;
	} else if (z <= -7.8e-241) {
		tmp = x * -3.0;
	} else if (z <= 4.5e-257) {
		tmp = y * 4.0;
	} else if (z <= 1.3e-151) {
		tmp = x * -3.0;
	} else if (z <= 3.3e-39) {
		tmp = y * 4.0;
	} else if (z <= 6400.0) {
		tmp = x * ((z * 6.0) - 3.0);
	} else {
		tmp = t_0;
	}
	return tmp;
}
def code(x, y, z):
	t_0 = -6.0 * (z * (y - x))
	tmp = 0
	if z <= -0.0126:
		tmp = t_0
	elif z <= -5.5e-126:
		tmp = y * 4.0
	elif z <= -5e-148:
		tmp = x * -3.0
	elif z <= -9e-203:
		tmp = y * 4.0
	elif z <= -7.8e-241:
		tmp = x * -3.0
	elif z <= 4.5e-257:
		tmp = y * 4.0
	elif z <= 1.3e-151:
		tmp = x * -3.0
	elif z <= 3.3e-39:
		tmp = y * 4.0
	elif z <= 6400.0:
		tmp = x * ((z * 6.0) - 3.0)
	else:
		tmp = t_0
	return tmp
function code(x, y, z)
	t_0 = Float64(-6.0 * Float64(z * Float64(y - x)))
	tmp = 0.0
	if (z <= -0.0126)
		tmp = t_0;
	elseif (z <= -5.5e-126)
		tmp = Float64(y * 4.0);
	elseif (z <= -5e-148)
		tmp = Float64(x * -3.0);
	elseif (z <= -9e-203)
		tmp = Float64(y * 4.0);
	elseif (z <= -7.8e-241)
		tmp = Float64(x * -3.0);
	elseif (z <= 4.5e-257)
		tmp = Float64(y * 4.0);
	elseif (z <= 1.3e-151)
		tmp = Float64(x * -3.0);
	elseif (z <= 3.3e-39)
		tmp = Float64(y * 4.0);
	elseif (z <= 6400.0)
		tmp = Float64(x * Float64(Float64(z * 6.0) - 3.0));
	else
		tmp = t_0;
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	t_0 = -6.0 * (z * (y - x));
	tmp = 0.0;
	if (z <= -0.0126)
		tmp = t_0;
	elseif (z <= -5.5e-126)
		tmp = y * 4.0;
	elseif (z <= -5e-148)
		tmp = x * -3.0;
	elseif (z <= -9e-203)
		tmp = y * 4.0;
	elseif (z <= -7.8e-241)
		tmp = x * -3.0;
	elseif (z <= 4.5e-257)
		tmp = y * 4.0;
	elseif (z <= 1.3e-151)
		tmp = x * -3.0;
	elseif (z <= 3.3e-39)
		tmp = y * 4.0;
	elseif (z <= 6400.0)
		tmp = x * ((z * 6.0) - 3.0);
	else
		tmp = t_0;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := Block[{t$95$0 = N[(-6.0 * N[(z * N[(y - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -0.0126], t$95$0, If[LessEqual[z, -5.5e-126], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, -5e-148], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, -9e-203], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, -7.8e-241], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 4.5e-257], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 1.3e-151], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 3.3e-39], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 6400.0], N[(x * N[(N[(z * 6.0), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision], t$95$0]]]]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;z \leq -5.5 \cdot 10^{-126}:\\
\;\;\;\;y \cdot 4\\

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

\mathbf{elif}\;z \leq -9 \cdot 10^{-203}:\\
\;\;\;\;y \cdot 4\\

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

\mathbf{elif}\;z \leq 4.5 \cdot 10^{-257}:\\
\;\;\;\;y \cdot 4\\

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

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

\mathbf{elif}\;z \leq 6400:\\
\;\;\;\;x \cdot \left(z \cdot 6 - 3\right)\\

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


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

    1. Initial program 99.8%

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

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

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

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

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

    if -0.0126 < z < -5.49999999999999987e-126 or -4.9999999999999999e-148 < z < -9.0000000000000003e-203 or -7.7999999999999998e-241 < z < 4.5000000000000003e-257 or 1.3e-151 < z < 3.29999999999999985e-39

    1. Initial program 99.3%

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

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

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

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

      \[\leadsto \color{blue}{4 \cdot y} \]
    6. Step-by-step derivation
      1. *-commutative66.9%

        \[\leadsto \color{blue}{y \cdot 4} \]
    7. Simplified66.9%

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

    if -5.49999999999999987e-126 < z < -4.9999999999999999e-148 or -9.0000000000000003e-203 < z < -7.7999999999999998e-241 or 4.5000000000000003e-257 < z < 1.3e-151

    1. Initial program 99.4%

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

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

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

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

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

        \[\leadsto \color{blue}{x \cdot -3} \]
    7. Simplified81.5%

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

    if 3.29999999999999985e-39 < z < 6400

    1. Initial program 99.3%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -0.0126:\\ \;\;\;\;-6 \cdot \left(z \cdot \left(y - x\right)\right)\\ \mathbf{elif}\;z \leq -5.5 \cdot 10^{-126}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq -5 \cdot 10^{-148}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq -9 \cdot 10^{-203}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq -7.8 \cdot 10^{-241}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 4.5 \cdot 10^{-257}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 1.3 \cdot 10^{-151}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 3.3 \cdot 10^{-39}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 6400:\\ \;\;\;\;x \cdot \left(z \cdot 6 - 3\right)\\ \mathbf{else}:\\ \;\;\;\;-6 \cdot \left(z \cdot \left(y - x\right)\right)\\ \end{array} \]

Alternative 5: 72.6% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := -6 \cdot \left(z \cdot \left(y - x\right)\right)\\ \mathbf{if}\;z \leq -0.034:\\ \;\;\;\;t_0\\ \mathbf{elif}\;z \leq -5.5 \cdot 10^{-129}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq -1.9 \cdot 10^{-148}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq -2.9 \cdot 10^{-208}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq -1 \cdot 10^{-241}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 3.7 \cdot 10^{-257}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 2.35 \cdot 10^{-151}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 0.55:\\ \;\;\;\;y \cdot 4\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (let* ((t_0 (* -6.0 (* z (- y x)))))
   (if (<= z -0.034)
     t_0
     (if (<= z -5.5e-129)
       (* y 4.0)
       (if (<= z -1.9e-148)
         (* x -3.0)
         (if (<= z -2.9e-208)
           (* y 4.0)
           (if (<= z -1e-241)
             (* x -3.0)
             (if (<= z 3.7e-257)
               (* y 4.0)
               (if (<= z 2.35e-151)
                 (* x -3.0)
                 (if (<= z 0.55) (* y 4.0) t_0))))))))))
double code(double x, double y, double z) {
	double t_0 = -6.0 * (z * (y - x));
	double tmp;
	if (z <= -0.034) {
		tmp = t_0;
	} else if (z <= -5.5e-129) {
		tmp = y * 4.0;
	} else if (z <= -1.9e-148) {
		tmp = x * -3.0;
	} else if (z <= -2.9e-208) {
		tmp = y * 4.0;
	} else if (z <= -1e-241) {
		tmp = x * -3.0;
	} else if (z <= 3.7e-257) {
		tmp = y * 4.0;
	} else if (z <= 2.35e-151) {
		tmp = x * -3.0;
	} else if (z <= 0.55) {
		tmp = y * 4.0;
	} else {
		tmp = t_0;
	}
	return tmp;
}
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8) :: t_0
    real(8) :: tmp
    t_0 = (-6.0d0) * (z * (y - x))
    if (z <= (-0.034d0)) then
        tmp = t_0
    else if (z <= (-5.5d-129)) then
        tmp = y * 4.0d0
    else if (z <= (-1.9d-148)) then
        tmp = x * (-3.0d0)
    else if (z <= (-2.9d-208)) then
        tmp = y * 4.0d0
    else if (z <= (-1d-241)) then
        tmp = x * (-3.0d0)
    else if (z <= 3.7d-257) then
        tmp = y * 4.0d0
    else if (z <= 2.35d-151) then
        tmp = x * (-3.0d0)
    else if (z <= 0.55d0) then
        tmp = y * 4.0d0
    else
        tmp = t_0
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double t_0 = -6.0 * (z * (y - x));
	double tmp;
	if (z <= -0.034) {
		tmp = t_0;
	} else if (z <= -5.5e-129) {
		tmp = y * 4.0;
	} else if (z <= -1.9e-148) {
		tmp = x * -3.0;
	} else if (z <= -2.9e-208) {
		tmp = y * 4.0;
	} else if (z <= -1e-241) {
		tmp = x * -3.0;
	} else if (z <= 3.7e-257) {
		tmp = y * 4.0;
	} else if (z <= 2.35e-151) {
		tmp = x * -3.0;
	} else if (z <= 0.55) {
		tmp = y * 4.0;
	} else {
		tmp = t_0;
	}
	return tmp;
}
def code(x, y, z):
	t_0 = -6.0 * (z * (y - x))
	tmp = 0
	if z <= -0.034:
		tmp = t_0
	elif z <= -5.5e-129:
		tmp = y * 4.0
	elif z <= -1.9e-148:
		tmp = x * -3.0
	elif z <= -2.9e-208:
		tmp = y * 4.0
	elif z <= -1e-241:
		tmp = x * -3.0
	elif z <= 3.7e-257:
		tmp = y * 4.0
	elif z <= 2.35e-151:
		tmp = x * -3.0
	elif z <= 0.55:
		tmp = y * 4.0
	else:
		tmp = t_0
	return tmp
function code(x, y, z)
	t_0 = Float64(-6.0 * Float64(z * Float64(y - x)))
	tmp = 0.0
	if (z <= -0.034)
		tmp = t_0;
	elseif (z <= -5.5e-129)
		tmp = Float64(y * 4.0);
	elseif (z <= -1.9e-148)
		tmp = Float64(x * -3.0);
	elseif (z <= -2.9e-208)
		tmp = Float64(y * 4.0);
	elseif (z <= -1e-241)
		tmp = Float64(x * -3.0);
	elseif (z <= 3.7e-257)
		tmp = Float64(y * 4.0);
	elseif (z <= 2.35e-151)
		tmp = Float64(x * -3.0);
	elseif (z <= 0.55)
		tmp = Float64(y * 4.0);
	else
		tmp = t_0;
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	t_0 = -6.0 * (z * (y - x));
	tmp = 0.0;
	if (z <= -0.034)
		tmp = t_0;
	elseif (z <= -5.5e-129)
		tmp = y * 4.0;
	elseif (z <= -1.9e-148)
		tmp = x * -3.0;
	elseif (z <= -2.9e-208)
		tmp = y * 4.0;
	elseif (z <= -1e-241)
		tmp = x * -3.0;
	elseif (z <= 3.7e-257)
		tmp = y * 4.0;
	elseif (z <= 2.35e-151)
		tmp = x * -3.0;
	elseif (z <= 0.55)
		tmp = y * 4.0;
	else
		tmp = t_0;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := Block[{t$95$0 = N[(-6.0 * N[(z * N[(y - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -0.034], t$95$0, If[LessEqual[z, -5.5e-129], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, -1.9e-148], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, -2.9e-208], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, -1e-241], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 3.7e-257], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 2.35e-151], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 0.55], N[(y * 4.0), $MachinePrecision], t$95$0]]]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;z \leq -5.5 \cdot 10^{-129}:\\
\;\;\;\;y \cdot 4\\

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

\mathbf{elif}\;z \leq -2.9 \cdot 10^{-208}:\\
\;\;\;\;y \cdot 4\\

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

\mathbf{elif}\;z \leq 3.7 \cdot 10^{-257}:\\
\;\;\;\;y \cdot 4\\

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

\mathbf{elif}\;z \leq 0.55:\\
\;\;\;\;y \cdot 4\\

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


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

    1. Initial program 99.8%

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

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

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

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

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

    if -0.034000000000000002 < z < -5.50000000000000023e-129 or -1.90000000000000007e-148 < z < -2.8999999999999999e-208 or -9.9999999999999997e-242 < z < 3.69999999999999984e-257 or 2.35000000000000014e-151 < z < 0.55000000000000004

    1. Initial program 99.3%

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

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

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

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

      \[\leadsto \color{blue}{4 \cdot y} \]
    6. Step-by-step derivation
      1. *-commutative64.3%

        \[\leadsto \color{blue}{y \cdot 4} \]
    7. Simplified64.3%

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

    if -5.50000000000000023e-129 < z < -1.90000000000000007e-148 or -2.8999999999999999e-208 < z < -9.9999999999999997e-242 or 3.69999999999999984e-257 < z < 2.35000000000000014e-151

    1. Initial program 99.4%

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

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

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

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

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

        \[\leadsto \color{blue}{x \cdot -3} \]
    7. Simplified81.5%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -0.034:\\ \;\;\;\;-6 \cdot \left(z \cdot \left(y - x\right)\right)\\ \mathbf{elif}\;z \leq -5.5 \cdot 10^{-129}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq -1.9 \cdot 10^{-148}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq -2.9 \cdot 10^{-208}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq -1 \cdot 10^{-241}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 3.7 \cdot 10^{-257}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 2.35 \cdot 10^{-151}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 0.55:\\ \;\;\;\;y \cdot 4\\ \mathbf{else}:\\ \;\;\;\;-6 \cdot \left(z \cdot \left(y - x\right)\right)\\ \end{array} \]

Alternative 6: 50.0% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := -6 \cdot \left(z \cdot y\right)\\ \mathbf{if}\;z \leq -0.66:\\ \;\;\;\;t_0\\ \mathbf{elif}\;z \leq -1 \cdot 10^{-126}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq -6 \cdot 10^{-149}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq -1.4 \cdot 10^{-198}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq -2.25 \cdot 10^{-241}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 2 \cdot 10^{-256}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 5.8 \cdot 10^{-147}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 0.68:\\ \;\;\;\;y \cdot 4\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (let* ((t_0 (* -6.0 (* z y))))
   (if (<= z -0.66)
     t_0
     (if (<= z -1e-126)
       (* y 4.0)
       (if (<= z -6e-149)
         (* x -3.0)
         (if (<= z -1.4e-198)
           (* y 4.0)
           (if (<= z -2.25e-241)
             (* x -3.0)
             (if (<= z 2e-256)
               (* y 4.0)
               (if (<= z 5.8e-147)
                 (* x -3.0)
                 (if (<= z 0.68) (* y 4.0) t_0))))))))))
double code(double x, double y, double z) {
	double t_0 = -6.0 * (z * y);
	double tmp;
	if (z <= -0.66) {
		tmp = t_0;
	} else if (z <= -1e-126) {
		tmp = y * 4.0;
	} else if (z <= -6e-149) {
		tmp = x * -3.0;
	} else if (z <= -1.4e-198) {
		tmp = y * 4.0;
	} else if (z <= -2.25e-241) {
		tmp = x * -3.0;
	} else if (z <= 2e-256) {
		tmp = y * 4.0;
	} else if (z <= 5.8e-147) {
		tmp = x * -3.0;
	} else if (z <= 0.68) {
		tmp = y * 4.0;
	} else {
		tmp = t_0;
	}
	return tmp;
}
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8) :: t_0
    real(8) :: tmp
    t_0 = (-6.0d0) * (z * y)
    if (z <= (-0.66d0)) then
        tmp = t_0
    else if (z <= (-1d-126)) then
        tmp = y * 4.0d0
    else if (z <= (-6d-149)) then
        tmp = x * (-3.0d0)
    else if (z <= (-1.4d-198)) then
        tmp = y * 4.0d0
    else if (z <= (-2.25d-241)) then
        tmp = x * (-3.0d0)
    else if (z <= 2d-256) then
        tmp = y * 4.0d0
    else if (z <= 5.8d-147) then
        tmp = x * (-3.0d0)
    else if (z <= 0.68d0) then
        tmp = y * 4.0d0
    else
        tmp = t_0
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double t_0 = -6.0 * (z * y);
	double tmp;
	if (z <= -0.66) {
		tmp = t_0;
	} else if (z <= -1e-126) {
		tmp = y * 4.0;
	} else if (z <= -6e-149) {
		tmp = x * -3.0;
	} else if (z <= -1.4e-198) {
		tmp = y * 4.0;
	} else if (z <= -2.25e-241) {
		tmp = x * -3.0;
	} else if (z <= 2e-256) {
		tmp = y * 4.0;
	} else if (z <= 5.8e-147) {
		tmp = x * -3.0;
	} else if (z <= 0.68) {
		tmp = y * 4.0;
	} else {
		tmp = t_0;
	}
	return tmp;
}
def code(x, y, z):
	t_0 = -6.0 * (z * y)
	tmp = 0
	if z <= -0.66:
		tmp = t_0
	elif z <= -1e-126:
		tmp = y * 4.0
	elif z <= -6e-149:
		tmp = x * -3.0
	elif z <= -1.4e-198:
		tmp = y * 4.0
	elif z <= -2.25e-241:
		tmp = x * -3.0
	elif z <= 2e-256:
		tmp = y * 4.0
	elif z <= 5.8e-147:
		tmp = x * -3.0
	elif z <= 0.68:
		tmp = y * 4.0
	else:
		tmp = t_0
	return tmp
function code(x, y, z)
	t_0 = Float64(-6.0 * Float64(z * y))
	tmp = 0.0
	if (z <= -0.66)
		tmp = t_0;
	elseif (z <= -1e-126)
		tmp = Float64(y * 4.0);
	elseif (z <= -6e-149)
		tmp = Float64(x * -3.0);
	elseif (z <= -1.4e-198)
		tmp = Float64(y * 4.0);
	elseif (z <= -2.25e-241)
		tmp = Float64(x * -3.0);
	elseif (z <= 2e-256)
		tmp = Float64(y * 4.0);
	elseif (z <= 5.8e-147)
		tmp = Float64(x * -3.0);
	elseif (z <= 0.68)
		tmp = Float64(y * 4.0);
	else
		tmp = t_0;
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	t_0 = -6.0 * (z * y);
	tmp = 0.0;
	if (z <= -0.66)
		tmp = t_0;
	elseif (z <= -1e-126)
		tmp = y * 4.0;
	elseif (z <= -6e-149)
		tmp = x * -3.0;
	elseif (z <= -1.4e-198)
		tmp = y * 4.0;
	elseif (z <= -2.25e-241)
		tmp = x * -3.0;
	elseif (z <= 2e-256)
		tmp = y * 4.0;
	elseif (z <= 5.8e-147)
		tmp = x * -3.0;
	elseif (z <= 0.68)
		tmp = y * 4.0;
	else
		tmp = t_0;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := Block[{t$95$0 = N[(-6.0 * N[(z * y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -0.66], t$95$0, If[LessEqual[z, -1e-126], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, -6e-149], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, -1.4e-198], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, -2.25e-241], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 2e-256], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 5.8e-147], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 0.68], N[(y * 4.0), $MachinePrecision], t$95$0]]]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;z \leq -1 \cdot 10^{-126}:\\
\;\;\;\;y \cdot 4\\

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

\mathbf{elif}\;z \leq -1.4 \cdot 10^{-198}:\\
\;\;\;\;y \cdot 4\\

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

\mathbf{elif}\;z \leq 2 \cdot 10^{-256}:\\
\;\;\;\;y \cdot 4\\

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

\mathbf{elif}\;z \leq 0.68:\\
\;\;\;\;y \cdot 4\\

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


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

    1. Initial program 99.8%

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

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

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

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

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

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

    if -0.660000000000000031 < z < -9.9999999999999995e-127 or -6.0000000000000003e-149 < z < -1.4e-198 or -2.2499999999999999e-241 < z < 1.99999999999999995e-256 or 5.8000000000000002e-147 < z < 0.680000000000000049

    1. Initial program 99.3%

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

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

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

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

      \[\leadsto \color{blue}{4 \cdot y} \]
    6. Step-by-step derivation
      1. *-commutative64.3%

        \[\leadsto \color{blue}{y \cdot 4} \]
    7. Simplified64.3%

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

    if -9.9999999999999995e-127 < z < -6.0000000000000003e-149 or -1.4e-198 < z < -2.2499999999999999e-241 or 1.99999999999999995e-256 < z < 5.8000000000000002e-147

    1. Initial program 99.4%

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

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

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

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

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

        \[\leadsto \color{blue}{x \cdot -3} \]
    7. Simplified81.5%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -0.66:\\ \;\;\;\;-6 \cdot \left(z \cdot y\right)\\ \mathbf{elif}\;z \leq -1 \cdot 10^{-126}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq -6 \cdot 10^{-149}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq -1.4 \cdot 10^{-198}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq -2.25 \cdot 10^{-241}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 2 \cdot 10^{-256}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 5.8 \cdot 10^{-147}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 0.68:\\ \;\;\;\;y \cdot 4\\ \mathbf{else}:\\ \;\;\;\;-6 \cdot \left(z \cdot y\right)\\ \end{array} \]

Alternative 7: 97.7% accurate, 1.0× speedup?

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

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

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

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


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

    1. Initial program 99.8%

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

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

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

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

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

    if -0.57999999999999996 < z < 0.57999999999999996

    1. Initial program 99.4%

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

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

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

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

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

    if 0.57999999999999996 < z

    1. Initial program 99.8%

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

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

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

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

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

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

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

Alternative 8: 76.1% accurate, 1.2× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -5.4 \cdot 10^{+44} \lor \neg \left(x \leq 4.1 \cdot 10^{+44}\right):\\
\;\;\;\;x \cdot \left(z \cdot 6 - 3\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -5.4e44 or 4.09999999999999965e44 < x

    1. Initial program 99.5%

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

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

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

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

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

    if -5.4e44 < x < 4.09999999999999965e44

    1. Initial program 99.6%

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -5.4 \cdot 10^{+44} \lor \neg \left(x \leq 4.1 \cdot 10^{+44}\right):\\ \;\;\;\;x \cdot \left(z \cdot 6 - 3\right)\\ \mathbf{else}:\\ \;\;\;\;y \cdot \left(4 + -6 \cdot z\right)\\ \end{array} \]

Alternative 9: 97.7% accurate, 1.2× speedup?

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

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

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


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

    1. Initial program 99.8%

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

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

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

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

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

    if -0.57999999999999996 < z < 0.619999999999999996

    1. Initial program 99.4%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -0.58 \lor \neg \left(z \leq 0.62\right):\\ \;\;\;\;-6 \cdot \left(z \cdot \left(y - x\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x + \left(y - x\right) \cdot 4\\ \end{array} \]

Alternative 10: 97.7% accurate, 1.2× speedup?

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

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

\mathbf{else}:\\
\;\;\;\;y \cdot 4 + x \cdot -3\\


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

    1. Initial program 99.8%

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

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

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

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

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

    if -0.57999999999999996 < z < 0.5

    1. Initial program 99.4%

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

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

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

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

      \[\leadsto \color{blue}{-3 \cdot x + 4 \cdot y} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification98.4%

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -0.58 \lor \neg \left(z \leq 0.5\right):\\ \;\;\;\;-6 \cdot \left(z \cdot \left(y - x\right)\right)\\ \mathbf{else}:\\ \;\;\;\;y \cdot 4 + x \cdot -3\\ \end{array} \]

Alternative 11: 99.5% accurate, 1.2× speedup?

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

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

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

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

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

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

Alternative 12: 99.7% accurate, 1.2× speedup?

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

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

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

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

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

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

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

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

    \[\leadsto \color{blue}{\mathsf{fma}\left(6, \left(y - x\right) \cdot \left(0.6666666666666666 - z\right), x\right)} \]
  4. Step-by-step derivation
    1. fma-udef99.5%

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

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

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

      \[\leadsto \color{blue}{\left(y - x\right) \cdot \left(6 \cdot \left(0.6666666666666666 - z\right)\right)} + x \]
  5. Applied egg-rr99.8%

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

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

Alternative 13: 38.7% accurate, 1.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.3 \cdot 10^{+15} \lor \neg \left(x \leq 3.1 \cdot 10^{+44}\right):\\
\;\;\;\;x \cdot -3\\

\mathbf{else}:\\
\;\;\;\;y \cdot 4\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -2.3e15 or 3.09999999999999996e44 < x

    1. Initial program 99.5%

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

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

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

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

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

        \[\leadsto \color{blue}{x \cdot -3} \]
    7. Simplified43.0%

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

    if -2.3e15 < x < 3.09999999999999996e44

    1. Initial program 99.6%

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

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

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

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

      \[\leadsto \color{blue}{4 \cdot y} \]
    6. Step-by-step derivation
      1. *-commutative41.8%

        \[\leadsto \color{blue}{y \cdot 4} \]
    7. Simplified41.8%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -2.3 \cdot 10^{+15} \lor \neg \left(x \leq 3.1 \cdot 10^{+44}\right):\\ \;\;\;\;x \cdot -3\\ \mathbf{else}:\\ \;\;\;\;y \cdot 4\\ \end{array} \]

Alternative 14: 26.7% accurate, 4.3× speedup?

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

\\
x \cdot -3
\end{array}
Derivation
  1. Initial program 99.6%

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

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

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

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

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

      \[\leadsto \color{blue}{x \cdot -3} \]
  7. Simplified26.1%

    \[\leadsto \color{blue}{x \cdot -3} \]
  8. Final simplification26.1%

    \[\leadsto x \cdot -3 \]

Alternative 15: 2.6% accurate, 13.0× speedup?

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

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

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

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

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

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

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

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

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

    \[\leadsto x \]

Reproduce

?
herbie shell --seed 2023310 
(FPCore (x y z)
  :name "Data.Colour.RGBSpace.HSL:hsl from colour-2.3.3, D"
  :precision binary64
  (+ x (* (* (- y x) 6.0) (- (/ 2.0 3.0) z))))