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

Percentage Accurate: 99.5% → 99.8%
Time: 13.3s
Alternatives: 19
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 19 alternatives:

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

Initial Program: 99.5% accurate, 1.0× speedup?

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

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

Alternative 1: 99.8% accurate, 0.1× speedup?

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

\\
\mathsf{fma}\left(y - x, \mathsf{fma}\left(z, -6, 4\right), x\right)
\end{array}
Derivation
  1. Initial program 99.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. associate-*l*99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 99.8% accurate, 0.1× speedup?

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

\\
\mathsf{fma}\left(y - x, 4 + z \cdot -6, x\right)
\end{array}
Derivation
  1. Initial program 99.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. associate-*l*99.8%

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 49.8% accurate, 0.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := z \cdot \left(y \cdot -6\right)\\ t_1 := y \cdot \left(z \cdot -6\right)\\ t_2 := z \cdot \left(x \cdot 6\right)\\ t_3 := x \cdot \left(z \cdot 6\right)\\ \mathbf{if}\;z \leq -3.8 \cdot 10^{+237}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq -1.3 \cdot 10^{+195}:\\ \;\;\;\;t\_3\\ \mathbf{elif}\;z \leq -3.8 \cdot 10^{+167}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;z \leq -4.8 \cdot 10^{+150}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;z \leq -5.7 \cdot 10^{+113}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq -1.05 \cdot 10^{+14}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;z \leq -8.6 \cdot 10^{-55}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq -5.3 \cdot 10^{-214}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 4.9 \cdot 10^{-298}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 1.8 \cdot 10^{-168}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 3.3 \cdot 10^{-124}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 1.85 \cdot 10^{-45}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 8.8 \cdot 10^{-9}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 1.15 \cdot 10^{+184}:\\ \;\;\;\;t\_0\\ \mathbf{else}:\\ \;\;\;\;t\_3\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (let* ((t_0 (* z (* y -6.0)))
        (t_1 (* y (* z -6.0)))
        (t_2 (* z (* x 6.0)))
        (t_3 (* x (* z 6.0))))
   (if (<= z -3.8e+237)
     t_1
     (if (<= z -1.3e+195)
       t_3
       (if (<= z -3.8e+167)
         t_0
         (if (<= z -4.8e+150)
           t_2
           (if (<= z -5.7e+113)
             t_1
             (if (<= z -1.05e+14)
               t_2
               (if (<= z -8.6e-55)
                 (* y 4.0)
                 (if (<= z -5.3e-214)
                   (* x -3.0)
                   (if (<= z 4.9e-298)
                     (* y 4.0)
                     (if (<= z 1.8e-168)
                       (* x -3.0)
                       (if (<= z 3.3e-124)
                         (* y 4.0)
                         (if (<= z 1.85e-45)
                           (* x -3.0)
                           (if (<= z 8.8e-9)
                             (* y 4.0)
                             (if (<= z 1.15e+184) t_0 t_3))))))))))))))))
double code(double x, double y, double z) {
	double t_0 = z * (y * -6.0);
	double t_1 = y * (z * -6.0);
	double t_2 = z * (x * 6.0);
	double t_3 = x * (z * 6.0);
	double tmp;
	if (z <= -3.8e+237) {
		tmp = t_1;
	} else if (z <= -1.3e+195) {
		tmp = t_3;
	} else if (z <= -3.8e+167) {
		tmp = t_0;
	} else if (z <= -4.8e+150) {
		tmp = t_2;
	} else if (z <= -5.7e+113) {
		tmp = t_1;
	} else if (z <= -1.05e+14) {
		tmp = t_2;
	} else if (z <= -8.6e-55) {
		tmp = y * 4.0;
	} else if (z <= -5.3e-214) {
		tmp = x * -3.0;
	} else if (z <= 4.9e-298) {
		tmp = y * 4.0;
	} else if (z <= 1.8e-168) {
		tmp = x * -3.0;
	} else if (z <= 3.3e-124) {
		tmp = y * 4.0;
	} else if (z <= 1.85e-45) {
		tmp = x * -3.0;
	} else if (z <= 8.8e-9) {
		tmp = y * 4.0;
	} else if (z <= 1.15e+184) {
		tmp = t_0;
	} else {
		tmp = t_3;
	}
	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) :: t_2
    real(8) :: t_3
    real(8) :: tmp
    t_0 = z * (y * (-6.0d0))
    t_1 = y * (z * (-6.0d0))
    t_2 = z * (x * 6.0d0)
    t_3 = x * (z * 6.0d0)
    if (z <= (-3.8d+237)) then
        tmp = t_1
    else if (z <= (-1.3d+195)) then
        tmp = t_3
    else if (z <= (-3.8d+167)) then
        tmp = t_0
    else if (z <= (-4.8d+150)) then
        tmp = t_2
    else if (z <= (-5.7d+113)) then
        tmp = t_1
    else if (z <= (-1.05d+14)) then
        tmp = t_2
    else if (z <= (-8.6d-55)) then
        tmp = y * 4.0d0
    else if (z <= (-5.3d-214)) then
        tmp = x * (-3.0d0)
    else if (z <= 4.9d-298) then
        tmp = y * 4.0d0
    else if (z <= 1.8d-168) then
        tmp = x * (-3.0d0)
    else if (z <= 3.3d-124) then
        tmp = y * 4.0d0
    else if (z <= 1.85d-45) then
        tmp = x * (-3.0d0)
    else if (z <= 8.8d-9) then
        tmp = y * 4.0d0
    else if (z <= 1.15d+184) then
        tmp = t_0
    else
        tmp = t_3
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double t_0 = z * (y * -6.0);
	double t_1 = y * (z * -6.0);
	double t_2 = z * (x * 6.0);
	double t_3 = x * (z * 6.0);
	double tmp;
	if (z <= -3.8e+237) {
		tmp = t_1;
	} else if (z <= -1.3e+195) {
		tmp = t_3;
	} else if (z <= -3.8e+167) {
		tmp = t_0;
	} else if (z <= -4.8e+150) {
		tmp = t_2;
	} else if (z <= -5.7e+113) {
		tmp = t_1;
	} else if (z <= -1.05e+14) {
		tmp = t_2;
	} else if (z <= -8.6e-55) {
		tmp = y * 4.0;
	} else if (z <= -5.3e-214) {
		tmp = x * -3.0;
	} else if (z <= 4.9e-298) {
		tmp = y * 4.0;
	} else if (z <= 1.8e-168) {
		tmp = x * -3.0;
	} else if (z <= 3.3e-124) {
		tmp = y * 4.0;
	} else if (z <= 1.85e-45) {
		tmp = x * -3.0;
	} else if (z <= 8.8e-9) {
		tmp = y * 4.0;
	} else if (z <= 1.15e+184) {
		tmp = t_0;
	} else {
		tmp = t_3;
	}
	return tmp;
}
def code(x, y, z):
	t_0 = z * (y * -6.0)
	t_1 = y * (z * -6.0)
	t_2 = z * (x * 6.0)
	t_3 = x * (z * 6.0)
	tmp = 0
	if z <= -3.8e+237:
		tmp = t_1
	elif z <= -1.3e+195:
		tmp = t_3
	elif z <= -3.8e+167:
		tmp = t_0
	elif z <= -4.8e+150:
		tmp = t_2
	elif z <= -5.7e+113:
		tmp = t_1
	elif z <= -1.05e+14:
		tmp = t_2
	elif z <= -8.6e-55:
		tmp = y * 4.0
	elif z <= -5.3e-214:
		tmp = x * -3.0
	elif z <= 4.9e-298:
		tmp = y * 4.0
	elif z <= 1.8e-168:
		tmp = x * -3.0
	elif z <= 3.3e-124:
		tmp = y * 4.0
	elif z <= 1.85e-45:
		tmp = x * -3.0
	elif z <= 8.8e-9:
		tmp = y * 4.0
	elif z <= 1.15e+184:
		tmp = t_0
	else:
		tmp = t_3
	return tmp
function code(x, y, z)
	t_0 = Float64(z * Float64(y * -6.0))
	t_1 = Float64(y * Float64(z * -6.0))
	t_2 = Float64(z * Float64(x * 6.0))
	t_3 = Float64(x * Float64(z * 6.0))
	tmp = 0.0
	if (z <= -3.8e+237)
		tmp = t_1;
	elseif (z <= -1.3e+195)
		tmp = t_3;
	elseif (z <= -3.8e+167)
		tmp = t_0;
	elseif (z <= -4.8e+150)
		tmp = t_2;
	elseif (z <= -5.7e+113)
		tmp = t_1;
	elseif (z <= -1.05e+14)
		tmp = t_2;
	elseif (z <= -8.6e-55)
		tmp = Float64(y * 4.0);
	elseif (z <= -5.3e-214)
		tmp = Float64(x * -3.0);
	elseif (z <= 4.9e-298)
		tmp = Float64(y * 4.0);
	elseif (z <= 1.8e-168)
		tmp = Float64(x * -3.0);
	elseif (z <= 3.3e-124)
		tmp = Float64(y * 4.0);
	elseif (z <= 1.85e-45)
		tmp = Float64(x * -3.0);
	elseif (z <= 8.8e-9)
		tmp = Float64(y * 4.0);
	elseif (z <= 1.15e+184)
		tmp = t_0;
	else
		tmp = t_3;
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	t_0 = z * (y * -6.0);
	t_1 = y * (z * -6.0);
	t_2 = z * (x * 6.0);
	t_3 = x * (z * 6.0);
	tmp = 0.0;
	if (z <= -3.8e+237)
		tmp = t_1;
	elseif (z <= -1.3e+195)
		tmp = t_3;
	elseif (z <= -3.8e+167)
		tmp = t_0;
	elseif (z <= -4.8e+150)
		tmp = t_2;
	elseif (z <= -5.7e+113)
		tmp = t_1;
	elseif (z <= -1.05e+14)
		tmp = t_2;
	elseif (z <= -8.6e-55)
		tmp = y * 4.0;
	elseif (z <= -5.3e-214)
		tmp = x * -3.0;
	elseif (z <= 4.9e-298)
		tmp = y * 4.0;
	elseif (z <= 1.8e-168)
		tmp = x * -3.0;
	elseif (z <= 3.3e-124)
		tmp = y * 4.0;
	elseif (z <= 1.85e-45)
		tmp = x * -3.0;
	elseif (z <= 8.8e-9)
		tmp = y * 4.0;
	elseif (z <= 1.15e+184)
		tmp = t_0;
	else
		tmp = t_3;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := Block[{t$95$0 = N[(z * N[(y * -6.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(y * N[(z * -6.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(z * N[(x * 6.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(x * N[(z * 6.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -3.8e+237], t$95$1, If[LessEqual[z, -1.3e+195], t$95$3, If[LessEqual[z, -3.8e+167], t$95$0, If[LessEqual[z, -4.8e+150], t$95$2, If[LessEqual[z, -5.7e+113], t$95$1, If[LessEqual[z, -1.05e+14], t$95$2, If[LessEqual[z, -8.6e-55], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, -5.3e-214], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 4.9e-298], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 1.8e-168], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 3.3e-124], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 1.85e-45], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 8.8e-9], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 1.15e+184], t$95$0, t$95$3]]]]]]]]]]]]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := z \cdot \left(y \cdot -6\right)\\
t_1 := y \cdot \left(z \cdot -6\right)\\
t_2 := z \cdot \left(x \cdot 6\right)\\
t_3 := x \cdot \left(z \cdot 6\right)\\
\mathbf{if}\;z \leq -3.8 \cdot 10^{+237}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;z \leq -1.3 \cdot 10^{+195}:\\
\;\;\;\;t\_3\\

\mathbf{elif}\;z \leq -3.8 \cdot 10^{+167}:\\
\;\;\;\;t\_0\\

\mathbf{elif}\;z \leq -4.8 \cdot 10^{+150}:\\
\;\;\;\;t\_2\\

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

\mathbf{elif}\;z \leq -1.05 \cdot 10^{+14}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;z \leq -8.6 \cdot 10^{-55}:\\
\;\;\;\;y \cdot 4\\

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

\mathbf{elif}\;z \leq 4.9 \cdot 10^{-298}:\\
\;\;\;\;y \cdot 4\\

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

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 6 regimes
  2. if z < -3.8e237 or -4.80000000000000005e150 < z < -5.6999999999999998e113

    1. Initial program 99.8%

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

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

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

        \[\leadsto \color{blue}{\frac{x \cdot x - \left(\left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right)\right) \cdot \left(\left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right)\right)}{x - \left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right)}} \]
      2. div-inv25.9%

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

        \[\leadsto \left(\color{blue}{{x}^{2}} - \left(\left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right)\right) \cdot \left(\left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right)\right)\right) \cdot \frac{1}{x - \left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right)} \]
      4. pow225.9%

        \[\leadsto \left({x}^{2} - \color{blue}{{\left(\left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right)\right)}^{2}}\right) \cdot \frac{1}{x - \left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right)} \]
      5. associate-*l*25.9%

        \[\leadsto \left({x}^{2} - {\color{blue}{\left(\left(y - x\right) \cdot \left(6 \cdot \left(0.6666666666666666 - z\right)\right)\right)}}^{2}\right) \cdot \frac{1}{x - \left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right)} \]
      6. associate-*l*26.0%

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

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

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

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

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

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

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

    if -3.8e237 < z < -1.30000000000000001e195 or 1.15e184 < z

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto x \cdot \left(\color{blue}{-3} + \left(-z \cdot -6\right)\right) \]
      9. distribute-rgt-neg-in64.7%

        \[\leadsto x \cdot \left(-3 + \color{blue}{z \cdot \left(--6\right)}\right) \]
      10. metadata-eval64.7%

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

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

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

    if -1.30000000000000001e195 < z < -3.79999999999999994e167 or 8.7999999999999994e-9 < z < 1.15e184

    1. Initial program 99.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -3.79999999999999994e167 < z < -4.80000000000000005e150 or -5.6999999999999998e113 < z < -1.05e14

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.05e14 < z < -8.60000000000000021e-55 or -5.30000000000000005e-214 < z < 4.9e-298 or 1.7999999999999999e-168 < z < 3.29999999999999984e-124 or 1.85e-45 < z < 8.7999999999999994e-9

    1. Initial program 99.5%

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

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

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

        \[\leadsto \color{blue}{\frac{x \cdot x - \left(\left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right)\right) \cdot \left(\left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right)\right)}{x - \left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right)}} \]
      2. div-inv46.8%

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

        \[\leadsto \left(\color{blue}{{x}^{2}} - \left(\left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right)\right) \cdot \left(\left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right)\right)\right) \cdot \frac{1}{x - \left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right)} \]
      4. pow246.8%

        \[\leadsto \left({x}^{2} - \color{blue}{{\left(\left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right)\right)}^{2}}\right) \cdot \frac{1}{x - \left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right)} \]
      5. associate-*l*46.8%

        \[\leadsto \left({x}^{2} - {\color{blue}{\left(\left(y - x\right) \cdot \left(6 \cdot \left(0.6666666666666666 - z\right)\right)\right)}}^{2}\right) \cdot \frac{1}{x - \left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right)} \]
      6. associate-*l*46.9%

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{y \cdot 4} \]
    13. Simplified67.1%

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

    if -8.60000000000000021e-55 < z < -5.30000000000000005e-214 or 4.9e-298 < z < 1.7999999999999999e-168 or 3.29999999999999984e-124 < z < 1.85e-45

    1. Initial program 99.5%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto x \cdot \left(\color{blue}{-3} + \left(-z \cdot -6\right)\right) \]
      9. distribute-rgt-neg-in73.7%

        \[\leadsto x \cdot \left(-3 + \color{blue}{z \cdot \left(--6\right)}\right) \]
      10. metadata-eval73.7%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -3.8 \cdot 10^{+237}:\\ \;\;\;\;y \cdot \left(z \cdot -6\right)\\ \mathbf{elif}\;z \leq -1.3 \cdot 10^{+195}:\\ \;\;\;\;x \cdot \left(z \cdot 6\right)\\ \mathbf{elif}\;z \leq -3.8 \cdot 10^{+167}:\\ \;\;\;\;z \cdot \left(y \cdot -6\right)\\ \mathbf{elif}\;z \leq -4.8 \cdot 10^{+150}:\\ \;\;\;\;z \cdot \left(x \cdot 6\right)\\ \mathbf{elif}\;z \leq -5.7 \cdot 10^{+113}:\\ \;\;\;\;y \cdot \left(z \cdot -6\right)\\ \mathbf{elif}\;z \leq -1.05 \cdot 10^{+14}:\\ \;\;\;\;z \cdot \left(x \cdot 6\right)\\ \mathbf{elif}\;z \leq -8.6 \cdot 10^{-55}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq -5.3 \cdot 10^{-214}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 4.9 \cdot 10^{-298}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 1.8 \cdot 10^{-168}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 3.3 \cdot 10^{-124}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 1.85 \cdot 10^{-45}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 8.8 \cdot 10^{-9}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 1.15 \cdot 10^{+184}:\\ \;\;\;\;z \cdot \left(y \cdot -6\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(z \cdot 6\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 50.0% accurate, 0.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := -6 \cdot \left(y \cdot z\right)\\ t_1 := x \cdot \left(z \cdot 6\right)\\ \mathbf{if}\;z \leq -3.3 \cdot 10^{+237}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;z \leq -1.02 \cdot 10^{+151}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq -3 \cdot 10^{+105}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;z \leq -1.05 \cdot 10^{+14}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq -1.08 \cdot 10^{-54}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq -4.2 \cdot 10^{-214}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 2.1 \cdot 10^{-298}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 3.9 \cdot 10^{-168}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 6.6 \cdot 10^{-116}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 1.03 \cdot 10^{-44}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 8.8 \cdot 10^{-9}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 6 \cdot 10^{+183}:\\ \;\;\;\;t\_0\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (let* ((t_0 (* -6.0 (* y z))) (t_1 (* x (* z 6.0))))
   (if (<= z -3.3e+237)
     t_0
     (if (<= z -1.02e+151)
       t_1
       (if (<= z -3e+105)
         t_0
         (if (<= z -1.05e+14)
           t_1
           (if (<= z -1.08e-54)
             (* y 4.0)
             (if (<= z -4.2e-214)
               (* x -3.0)
               (if (<= z 2.1e-298)
                 (* y 4.0)
                 (if (<= z 3.9e-168)
                   (* x -3.0)
                   (if (<= z 6.6e-116)
                     (* y 4.0)
                     (if (<= z 1.03e-44)
                       (* x -3.0)
                       (if (<= z 8.8e-9)
                         (* y 4.0)
                         (if (<= z 6e+183) t_0 t_1))))))))))))))
double code(double x, double y, double z) {
	double t_0 = -6.0 * (y * z);
	double t_1 = x * (z * 6.0);
	double tmp;
	if (z <= -3.3e+237) {
		tmp = t_0;
	} else if (z <= -1.02e+151) {
		tmp = t_1;
	} else if (z <= -3e+105) {
		tmp = t_0;
	} else if (z <= -1.05e+14) {
		tmp = t_1;
	} else if (z <= -1.08e-54) {
		tmp = y * 4.0;
	} else if (z <= -4.2e-214) {
		tmp = x * -3.0;
	} else if (z <= 2.1e-298) {
		tmp = y * 4.0;
	} else if (z <= 3.9e-168) {
		tmp = x * -3.0;
	} else if (z <= 6.6e-116) {
		tmp = y * 4.0;
	} else if (z <= 1.03e-44) {
		tmp = x * -3.0;
	} else if (z <= 8.8e-9) {
		tmp = y * 4.0;
	} else if (z <= 6e+183) {
		tmp = t_0;
	} else {
		tmp = t_1;
	}
	return tmp;
}
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8) :: t_0
    real(8) :: t_1
    real(8) :: tmp
    t_0 = (-6.0d0) * (y * z)
    t_1 = x * (z * 6.0d0)
    if (z <= (-3.3d+237)) then
        tmp = t_0
    else if (z <= (-1.02d+151)) then
        tmp = t_1
    else if (z <= (-3d+105)) then
        tmp = t_0
    else if (z <= (-1.05d+14)) then
        tmp = t_1
    else if (z <= (-1.08d-54)) then
        tmp = y * 4.0d0
    else if (z <= (-4.2d-214)) then
        tmp = x * (-3.0d0)
    else if (z <= 2.1d-298) then
        tmp = y * 4.0d0
    else if (z <= 3.9d-168) then
        tmp = x * (-3.0d0)
    else if (z <= 6.6d-116) then
        tmp = y * 4.0d0
    else if (z <= 1.03d-44) then
        tmp = x * (-3.0d0)
    else if (z <= 8.8d-9) then
        tmp = y * 4.0d0
    else if (z <= 6d+183) then
        tmp = t_0
    else
        tmp = t_1
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double t_0 = -6.0 * (y * z);
	double t_1 = x * (z * 6.0);
	double tmp;
	if (z <= -3.3e+237) {
		tmp = t_0;
	} else if (z <= -1.02e+151) {
		tmp = t_1;
	} else if (z <= -3e+105) {
		tmp = t_0;
	} else if (z <= -1.05e+14) {
		tmp = t_1;
	} else if (z <= -1.08e-54) {
		tmp = y * 4.0;
	} else if (z <= -4.2e-214) {
		tmp = x * -3.0;
	} else if (z <= 2.1e-298) {
		tmp = y * 4.0;
	} else if (z <= 3.9e-168) {
		tmp = x * -3.0;
	} else if (z <= 6.6e-116) {
		tmp = y * 4.0;
	} else if (z <= 1.03e-44) {
		tmp = x * -3.0;
	} else if (z <= 8.8e-9) {
		tmp = y * 4.0;
	} else if (z <= 6e+183) {
		tmp = t_0;
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z):
	t_0 = -6.0 * (y * z)
	t_1 = x * (z * 6.0)
	tmp = 0
	if z <= -3.3e+237:
		tmp = t_0
	elif z <= -1.02e+151:
		tmp = t_1
	elif z <= -3e+105:
		tmp = t_0
	elif z <= -1.05e+14:
		tmp = t_1
	elif z <= -1.08e-54:
		tmp = y * 4.0
	elif z <= -4.2e-214:
		tmp = x * -3.0
	elif z <= 2.1e-298:
		tmp = y * 4.0
	elif z <= 3.9e-168:
		tmp = x * -3.0
	elif z <= 6.6e-116:
		tmp = y * 4.0
	elif z <= 1.03e-44:
		tmp = x * -3.0
	elif z <= 8.8e-9:
		tmp = y * 4.0
	elif z <= 6e+183:
		tmp = t_0
	else:
		tmp = t_1
	return tmp
function code(x, y, z)
	t_0 = Float64(-6.0 * Float64(y * z))
	t_1 = Float64(x * Float64(z * 6.0))
	tmp = 0.0
	if (z <= -3.3e+237)
		tmp = t_0;
	elseif (z <= -1.02e+151)
		tmp = t_1;
	elseif (z <= -3e+105)
		tmp = t_0;
	elseif (z <= -1.05e+14)
		tmp = t_1;
	elseif (z <= -1.08e-54)
		tmp = Float64(y * 4.0);
	elseif (z <= -4.2e-214)
		tmp = Float64(x * -3.0);
	elseif (z <= 2.1e-298)
		tmp = Float64(y * 4.0);
	elseif (z <= 3.9e-168)
		tmp = Float64(x * -3.0);
	elseif (z <= 6.6e-116)
		tmp = Float64(y * 4.0);
	elseif (z <= 1.03e-44)
		tmp = Float64(x * -3.0);
	elseif (z <= 8.8e-9)
		tmp = Float64(y * 4.0);
	elseif (z <= 6e+183)
		tmp = t_0;
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	t_0 = -6.0 * (y * z);
	t_1 = x * (z * 6.0);
	tmp = 0.0;
	if (z <= -3.3e+237)
		tmp = t_0;
	elseif (z <= -1.02e+151)
		tmp = t_1;
	elseif (z <= -3e+105)
		tmp = t_0;
	elseif (z <= -1.05e+14)
		tmp = t_1;
	elseif (z <= -1.08e-54)
		tmp = y * 4.0;
	elseif (z <= -4.2e-214)
		tmp = x * -3.0;
	elseif (z <= 2.1e-298)
		tmp = y * 4.0;
	elseif (z <= 3.9e-168)
		tmp = x * -3.0;
	elseif (z <= 6.6e-116)
		tmp = y * 4.0;
	elseif (z <= 1.03e-44)
		tmp = x * -3.0;
	elseif (z <= 8.8e-9)
		tmp = y * 4.0;
	elseif (z <= 6e+183)
		tmp = t_0;
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := Block[{t$95$0 = N[(-6.0 * N[(y * z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x * N[(z * 6.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -3.3e+237], t$95$0, If[LessEqual[z, -1.02e+151], t$95$1, If[LessEqual[z, -3e+105], t$95$0, If[LessEqual[z, -1.05e+14], t$95$1, If[LessEqual[z, -1.08e-54], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, -4.2e-214], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 2.1e-298], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 3.9e-168], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 6.6e-116], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 1.03e-44], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 8.8e-9], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 6e+183], t$95$0, t$95$1]]]]]]]]]]]]]]
\begin{array}{l}

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

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

\mathbf{elif}\;z \leq -3 \cdot 10^{+105}:\\
\;\;\;\;t\_0\\

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

\mathbf{elif}\;z \leq -1.08 \cdot 10^{-54}:\\
\;\;\;\;y \cdot 4\\

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

\mathbf{elif}\;z \leq 2.1 \cdot 10^{-298}:\\
\;\;\;\;y \cdot 4\\

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

\mathbf{elif}\;z \leq 6.6 \cdot 10^{-116}:\\
\;\;\;\;y \cdot 4\\

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -3.3000000000000001e237 or -1.02000000000000002e151 < z < -3.0000000000000001e105 or 8.7999999999999994e-9 < z < 5.99999999999999992e183

    1. Initial program 99.7%

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

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

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

        \[\leadsto \color{blue}{\frac{x \cdot x - \left(\left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right)\right) \cdot \left(\left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right)\right)}{x - \left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right)}} \]
      2. div-inv21.4%

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

        \[\leadsto \left(\color{blue}{{x}^{2}} - \left(\left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right)\right) \cdot \left(\left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right)\right)\right) \cdot \frac{1}{x - \left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right)} \]
      4. pow221.4%

        \[\leadsto \left({x}^{2} - \color{blue}{{\left(\left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right)\right)}^{2}}\right) \cdot \frac{1}{x - \left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right)} \]
      5. associate-*l*21.3%

        \[\leadsto \left({x}^{2} - {\color{blue}{\left(\left(y - x\right) \cdot \left(6 \cdot \left(0.6666666666666666 - z\right)\right)\right)}}^{2}\right) \cdot \frac{1}{x - \left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right)} \]
      6. associate-*l*21.4%

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

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

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

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

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

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

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

    if -3.3000000000000001e237 < z < -1.02000000000000002e151 or -3.0000000000000001e105 < z < -1.05e14 or 5.99999999999999992e183 < z

    1. Initial program 99.8%

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

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

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

      \[\leadsto \color{blue}{x \cdot \left(1 + -6 \cdot \left(0.6666666666666666 - z\right)\right)} \]
    6. Step-by-step derivation
      1. sub-neg64.0%

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

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

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

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

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

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

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

        \[\leadsto x \cdot \left(\color{blue}{-3} + \left(-z \cdot -6\right)\right) \]
      9. distribute-rgt-neg-in64.0%

        \[\leadsto x \cdot \left(-3 + \color{blue}{z \cdot \left(--6\right)}\right) \]
      10. metadata-eval64.0%

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

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

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

    if -1.05e14 < z < -1.08000000000000002e-54 or -4.19999999999999984e-214 < z < 2.10000000000000005e-298 or 3.90000000000000012e-168 < z < 6.60000000000000002e-116 or 1.03e-44 < z < 8.7999999999999994e-9

    1. Initial program 99.5%

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

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

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

        \[\leadsto \color{blue}{\frac{x \cdot x - \left(\left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right)\right) \cdot \left(\left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right)\right)}{x - \left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right)}} \]
      2. div-inv46.8%

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

        \[\leadsto \left(\color{blue}{{x}^{2}} - \left(\left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right)\right) \cdot \left(\left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right)\right)\right) \cdot \frac{1}{x - \left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right)} \]
      4. pow246.8%

        \[\leadsto \left({x}^{2} - \color{blue}{{\left(\left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right)\right)}^{2}}\right) \cdot \frac{1}{x - \left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right)} \]
      5. associate-*l*46.8%

        \[\leadsto \left({x}^{2} - {\color{blue}{\left(\left(y - x\right) \cdot \left(6 \cdot \left(0.6666666666666666 - z\right)\right)\right)}}^{2}\right) \cdot \frac{1}{x - \left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right)} \]
      6. associate-*l*46.9%

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{y \cdot 4} \]
    13. Simplified67.1%

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

    if -1.08000000000000002e-54 < z < -4.19999999999999984e-214 or 2.10000000000000005e-298 < z < 3.90000000000000012e-168 or 6.60000000000000002e-116 < z < 1.03e-44

    1. Initial program 99.5%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto x \cdot \left(\color{blue}{-3} + \left(-z \cdot -6\right)\right) \]
      9. distribute-rgt-neg-in73.7%

        \[\leadsto x \cdot \left(-3 + \color{blue}{z \cdot \left(--6\right)}\right) \]
      10. metadata-eval73.7%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -3.3 \cdot 10^{+237}:\\ \;\;\;\;-6 \cdot \left(y \cdot z\right)\\ \mathbf{elif}\;z \leq -1.02 \cdot 10^{+151}:\\ \;\;\;\;x \cdot \left(z \cdot 6\right)\\ \mathbf{elif}\;z \leq -3 \cdot 10^{+105}:\\ \;\;\;\;-6 \cdot \left(y \cdot z\right)\\ \mathbf{elif}\;z \leq -1.05 \cdot 10^{+14}:\\ \;\;\;\;x \cdot \left(z \cdot 6\right)\\ \mathbf{elif}\;z \leq -1.08 \cdot 10^{-54}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq -4.2 \cdot 10^{-214}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 2.1 \cdot 10^{-298}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 3.9 \cdot 10^{-168}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 6.6 \cdot 10^{-116}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 1.03 \cdot 10^{-44}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 8.8 \cdot 10^{-9}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 6 \cdot 10^{+183}:\\ \;\;\;\;-6 \cdot \left(y \cdot z\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(z \cdot 6\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 49.7% accurate, 0.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := y \cdot \left(z \cdot -6\right)\\ t_1 := x \cdot \left(z \cdot 6\right)\\ \mathbf{if}\;z \leq -2.85 \cdot 10^{+237}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;z \leq -7.8 \cdot 10^{+148}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq -7.1 \cdot 10^{+106}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;z \leq -1.05 \cdot 10^{+14}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq -3.5 \cdot 10^{-54}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq -6 \cdot 10^{-214}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 1.35 \cdot 10^{-296}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 7.6 \cdot 10^{-167}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 4.5 \cdot 10^{-119}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 1.3 \cdot 10^{-48}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 8.8 \cdot 10^{-9}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 8 \cdot 10^{+185}:\\ \;\;\;\;t\_0\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (let* ((t_0 (* y (* z -6.0))) (t_1 (* x (* z 6.0))))
   (if (<= z -2.85e+237)
     t_0
     (if (<= z -7.8e+148)
       t_1
       (if (<= z -7.1e+106)
         t_0
         (if (<= z -1.05e+14)
           t_1
           (if (<= z -3.5e-54)
             (* y 4.0)
             (if (<= z -6e-214)
               (* x -3.0)
               (if (<= z 1.35e-296)
                 (* y 4.0)
                 (if (<= z 7.6e-167)
                   (* x -3.0)
                   (if (<= z 4.5e-119)
                     (* y 4.0)
                     (if (<= z 1.3e-48)
                       (* x -3.0)
                       (if (<= z 8.8e-9)
                         (* y 4.0)
                         (if (<= z 8e+185) t_0 t_1))))))))))))))
double code(double x, double y, double z) {
	double t_0 = y * (z * -6.0);
	double t_1 = x * (z * 6.0);
	double tmp;
	if (z <= -2.85e+237) {
		tmp = t_0;
	} else if (z <= -7.8e+148) {
		tmp = t_1;
	} else if (z <= -7.1e+106) {
		tmp = t_0;
	} else if (z <= -1.05e+14) {
		tmp = t_1;
	} else if (z <= -3.5e-54) {
		tmp = y * 4.0;
	} else if (z <= -6e-214) {
		tmp = x * -3.0;
	} else if (z <= 1.35e-296) {
		tmp = y * 4.0;
	} else if (z <= 7.6e-167) {
		tmp = x * -3.0;
	} else if (z <= 4.5e-119) {
		tmp = y * 4.0;
	} else if (z <= 1.3e-48) {
		tmp = x * -3.0;
	} else if (z <= 8.8e-9) {
		tmp = y * 4.0;
	} else if (z <= 8e+185) {
		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 * (z * (-6.0d0))
    t_1 = x * (z * 6.0d0)
    if (z <= (-2.85d+237)) then
        tmp = t_0
    else if (z <= (-7.8d+148)) then
        tmp = t_1
    else if (z <= (-7.1d+106)) then
        tmp = t_0
    else if (z <= (-1.05d+14)) then
        tmp = t_1
    else if (z <= (-3.5d-54)) then
        tmp = y * 4.0d0
    else if (z <= (-6d-214)) then
        tmp = x * (-3.0d0)
    else if (z <= 1.35d-296) then
        tmp = y * 4.0d0
    else if (z <= 7.6d-167) then
        tmp = x * (-3.0d0)
    else if (z <= 4.5d-119) then
        tmp = y * 4.0d0
    else if (z <= 1.3d-48) then
        tmp = x * (-3.0d0)
    else if (z <= 8.8d-9) then
        tmp = y * 4.0d0
    else if (z <= 8d+185) 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 * (z * -6.0);
	double t_1 = x * (z * 6.0);
	double tmp;
	if (z <= -2.85e+237) {
		tmp = t_0;
	} else if (z <= -7.8e+148) {
		tmp = t_1;
	} else if (z <= -7.1e+106) {
		tmp = t_0;
	} else if (z <= -1.05e+14) {
		tmp = t_1;
	} else if (z <= -3.5e-54) {
		tmp = y * 4.0;
	} else if (z <= -6e-214) {
		tmp = x * -3.0;
	} else if (z <= 1.35e-296) {
		tmp = y * 4.0;
	} else if (z <= 7.6e-167) {
		tmp = x * -3.0;
	} else if (z <= 4.5e-119) {
		tmp = y * 4.0;
	} else if (z <= 1.3e-48) {
		tmp = x * -3.0;
	} else if (z <= 8.8e-9) {
		tmp = y * 4.0;
	} else if (z <= 8e+185) {
		tmp = t_0;
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z):
	t_0 = y * (z * -6.0)
	t_1 = x * (z * 6.0)
	tmp = 0
	if z <= -2.85e+237:
		tmp = t_0
	elif z <= -7.8e+148:
		tmp = t_1
	elif z <= -7.1e+106:
		tmp = t_0
	elif z <= -1.05e+14:
		tmp = t_1
	elif z <= -3.5e-54:
		tmp = y * 4.0
	elif z <= -6e-214:
		tmp = x * -3.0
	elif z <= 1.35e-296:
		tmp = y * 4.0
	elif z <= 7.6e-167:
		tmp = x * -3.0
	elif z <= 4.5e-119:
		tmp = y * 4.0
	elif z <= 1.3e-48:
		tmp = x * -3.0
	elif z <= 8.8e-9:
		tmp = y * 4.0
	elif z <= 8e+185:
		tmp = t_0
	else:
		tmp = t_1
	return tmp
function code(x, y, z)
	t_0 = Float64(y * Float64(z * -6.0))
	t_1 = Float64(x * Float64(z * 6.0))
	tmp = 0.0
	if (z <= -2.85e+237)
		tmp = t_0;
	elseif (z <= -7.8e+148)
		tmp = t_1;
	elseif (z <= -7.1e+106)
		tmp = t_0;
	elseif (z <= -1.05e+14)
		tmp = t_1;
	elseif (z <= -3.5e-54)
		tmp = Float64(y * 4.0);
	elseif (z <= -6e-214)
		tmp = Float64(x * -3.0);
	elseif (z <= 1.35e-296)
		tmp = Float64(y * 4.0);
	elseif (z <= 7.6e-167)
		tmp = Float64(x * -3.0);
	elseif (z <= 4.5e-119)
		tmp = Float64(y * 4.0);
	elseif (z <= 1.3e-48)
		tmp = Float64(x * -3.0);
	elseif (z <= 8.8e-9)
		tmp = Float64(y * 4.0);
	elseif (z <= 8e+185)
		tmp = t_0;
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	t_0 = y * (z * -6.0);
	t_1 = x * (z * 6.0);
	tmp = 0.0;
	if (z <= -2.85e+237)
		tmp = t_0;
	elseif (z <= -7.8e+148)
		tmp = t_1;
	elseif (z <= -7.1e+106)
		tmp = t_0;
	elseif (z <= -1.05e+14)
		tmp = t_1;
	elseif (z <= -3.5e-54)
		tmp = y * 4.0;
	elseif (z <= -6e-214)
		tmp = x * -3.0;
	elseif (z <= 1.35e-296)
		tmp = y * 4.0;
	elseif (z <= 7.6e-167)
		tmp = x * -3.0;
	elseif (z <= 4.5e-119)
		tmp = y * 4.0;
	elseif (z <= 1.3e-48)
		tmp = x * -3.0;
	elseif (z <= 8.8e-9)
		tmp = y * 4.0;
	elseif (z <= 8e+185)
		tmp = t_0;
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := Block[{t$95$0 = N[(y * N[(z * -6.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x * N[(z * 6.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2.85e+237], t$95$0, If[LessEqual[z, -7.8e+148], t$95$1, If[LessEqual[z, -7.1e+106], t$95$0, If[LessEqual[z, -1.05e+14], t$95$1, If[LessEqual[z, -3.5e-54], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, -6e-214], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 1.35e-296], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 7.6e-167], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 4.5e-119], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 1.3e-48], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 8.8e-9], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 8e+185], t$95$0, t$95$1]]]]]]]]]]]]]]
\begin{array}{l}

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

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

\mathbf{elif}\;z \leq -7.1 \cdot 10^{+106}:\\
\;\;\;\;t\_0\\

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

\mathbf{elif}\;z \leq -3.5 \cdot 10^{-54}:\\
\;\;\;\;y \cdot 4\\

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

\mathbf{elif}\;z \leq 1.35 \cdot 10^{-296}:\\
\;\;\;\;y \cdot 4\\

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

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

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

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

\mathbf{elif}\;z \leq 8 \cdot 10^{+185}:\\
\;\;\;\;t\_0\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -2.84999999999999997e237 or -7.80000000000000004e148 < z < -7.1000000000000003e106 or 8.7999999999999994e-9 < z < 7.9999999999999998e185

    1. Initial program 99.7%

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

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

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

        \[\leadsto \color{blue}{\frac{x \cdot x - \left(\left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right)\right) \cdot \left(\left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right)\right)}{x - \left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right)}} \]
      2. div-inv21.4%

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

        \[\leadsto \left(\color{blue}{{x}^{2}} - \left(\left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right)\right) \cdot \left(\left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right)\right)\right) \cdot \frac{1}{x - \left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right)} \]
      4. pow221.4%

        \[\leadsto \left({x}^{2} - \color{blue}{{\left(\left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right)\right)}^{2}}\right) \cdot \frac{1}{x - \left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right)} \]
      5. associate-*l*21.3%

        \[\leadsto \left({x}^{2} - {\color{blue}{\left(\left(y - x\right) \cdot \left(6 \cdot \left(0.6666666666666666 - z\right)\right)\right)}}^{2}\right) \cdot \frac{1}{x - \left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right)} \]
      6. associate-*l*21.4%

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

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

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

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

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

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

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

    if -2.84999999999999997e237 < z < -7.80000000000000004e148 or -7.1000000000000003e106 < z < -1.05e14 or 7.9999999999999998e185 < z

    1. Initial program 99.8%

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

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

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

      \[\leadsto \color{blue}{x \cdot \left(1 + -6 \cdot \left(0.6666666666666666 - z\right)\right)} \]
    6. Step-by-step derivation
      1. sub-neg64.0%

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

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

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

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

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

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

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

        \[\leadsto x \cdot \left(\color{blue}{-3} + \left(-z \cdot -6\right)\right) \]
      9. distribute-rgt-neg-in64.0%

        \[\leadsto x \cdot \left(-3 + \color{blue}{z \cdot \left(--6\right)}\right) \]
      10. metadata-eval64.0%

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

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

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

    if -1.05e14 < z < -3.49999999999999982e-54 or -5.99999999999999989e-214 < z < 1.34999999999999999e-296 or 7.59999999999999934e-167 < z < 4.5000000000000003e-119 or 1.29999999999999994e-48 < z < 8.7999999999999994e-9

    1. Initial program 99.5%

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

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

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

        \[\leadsto \color{blue}{\frac{x \cdot x - \left(\left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right)\right) \cdot \left(\left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right)\right)}{x - \left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right)}} \]
      2. div-inv46.8%

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

        \[\leadsto \left(\color{blue}{{x}^{2}} - \left(\left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right)\right) \cdot \left(\left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right)\right)\right) \cdot \frac{1}{x - \left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right)} \]
      4. pow246.8%

        \[\leadsto \left({x}^{2} - \color{blue}{{\left(\left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right)\right)}^{2}}\right) \cdot \frac{1}{x - \left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right)} \]
      5. associate-*l*46.8%

        \[\leadsto \left({x}^{2} - {\color{blue}{\left(\left(y - x\right) \cdot \left(6 \cdot \left(0.6666666666666666 - z\right)\right)\right)}}^{2}\right) \cdot \frac{1}{x - \left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right)} \]
      6. associate-*l*46.9%

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{y \cdot 4} \]
    13. Simplified67.1%

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

    if -3.49999999999999982e-54 < z < -5.99999999999999989e-214 or 1.34999999999999999e-296 < z < 7.59999999999999934e-167 or 4.5000000000000003e-119 < z < 1.29999999999999994e-48

    1. Initial program 99.5%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto x \cdot \left(\color{blue}{-3} + \left(-z \cdot -6\right)\right) \]
      9. distribute-rgt-neg-in73.7%

        \[\leadsto x \cdot \left(-3 + \color{blue}{z \cdot \left(--6\right)}\right) \]
      10. metadata-eval73.7%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -2.85 \cdot 10^{+237}:\\ \;\;\;\;y \cdot \left(z \cdot -6\right)\\ \mathbf{elif}\;z \leq -7.8 \cdot 10^{+148}:\\ \;\;\;\;x \cdot \left(z \cdot 6\right)\\ \mathbf{elif}\;z \leq -7.1 \cdot 10^{+106}:\\ \;\;\;\;y \cdot \left(z \cdot -6\right)\\ \mathbf{elif}\;z \leq -1.05 \cdot 10^{+14}:\\ \;\;\;\;x \cdot \left(z \cdot 6\right)\\ \mathbf{elif}\;z \leq -3.5 \cdot 10^{-54}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq -6 \cdot 10^{-214}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 1.35 \cdot 10^{-296}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 7.6 \cdot 10^{-167}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 4.5 \cdot 10^{-119}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 1.3 \cdot 10^{-48}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 8.8 \cdot 10^{-9}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 8 \cdot 10^{+185}:\\ \;\;\;\;y \cdot \left(z \cdot -6\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(z \cdot 6\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 49.9% accurate, 0.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := y \cdot \left(z \cdot -6\right)\\ t_1 := x \cdot \left(z \cdot 6\right)\\ \mathbf{if}\;z \leq -1.5 \cdot 10^{+237}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;z \leq -4.9 \cdot 10^{+150}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq -4.5 \cdot 10^{+93}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;z \leq -1.05 \cdot 10^{+14}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq -4 \cdot 10^{-55}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq -3.1 \cdot 10^{-214}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 2.1 \cdot 10^{-297}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 1.45 \cdot 10^{-166}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 3.2 \cdot 10^{-123}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 1.45 \cdot 10^{-47}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 8.8 \cdot 10^{-9}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 3.1 \cdot 10^{+184}:\\ \;\;\;\;z \cdot \left(y \cdot -6\right)\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (let* ((t_0 (* y (* z -6.0))) (t_1 (* x (* z 6.0))))
   (if (<= z -1.5e+237)
     t_0
     (if (<= z -4.9e+150)
       t_1
       (if (<= z -4.5e+93)
         t_0
         (if (<= z -1.05e+14)
           t_1
           (if (<= z -4e-55)
             (* y 4.0)
             (if (<= z -3.1e-214)
               (* x -3.0)
               (if (<= z 2.1e-297)
                 (* y 4.0)
                 (if (<= z 1.45e-166)
                   (* x -3.0)
                   (if (<= z 3.2e-123)
                     (* y 4.0)
                     (if (<= z 1.45e-47)
                       (* x -3.0)
                       (if (<= z 8.8e-9)
                         (* y 4.0)
                         (if (<= z 3.1e+184) (* z (* y -6.0)) t_1))))))))))))))
double code(double x, double y, double z) {
	double t_0 = y * (z * -6.0);
	double t_1 = x * (z * 6.0);
	double tmp;
	if (z <= -1.5e+237) {
		tmp = t_0;
	} else if (z <= -4.9e+150) {
		tmp = t_1;
	} else if (z <= -4.5e+93) {
		tmp = t_0;
	} else if (z <= -1.05e+14) {
		tmp = t_1;
	} else if (z <= -4e-55) {
		tmp = y * 4.0;
	} else if (z <= -3.1e-214) {
		tmp = x * -3.0;
	} else if (z <= 2.1e-297) {
		tmp = y * 4.0;
	} else if (z <= 1.45e-166) {
		tmp = x * -3.0;
	} else if (z <= 3.2e-123) {
		tmp = y * 4.0;
	} else if (z <= 1.45e-47) {
		tmp = x * -3.0;
	} else if (z <= 8.8e-9) {
		tmp = y * 4.0;
	} else if (z <= 3.1e+184) {
		tmp = z * (y * -6.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 * (z * (-6.0d0))
    t_1 = x * (z * 6.0d0)
    if (z <= (-1.5d+237)) then
        tmp = t_0
    else if (z <= (-4.9d+150)) then
        tmp = t_1
    else if (z <= (-4.5d+93)) then
        tmp = t_0
    else if (z <= (-1.05d+14)) then
        tmp = t_1
    else if (z <= (-4d-55)) then
        tmp = y * 4.0d0
    else if (z <= (-3.1d-214)) then
        tmp = x * (-3.0d0)
    else if (z <= 2.1d-297) then
        tmp = y * 4.0d0
    else if (z <= 1.45d-166) then
        tmp = x * (-3.0d0)
    else if (z <= 3.2d-123) then
        tmp = y * 4.0d0
    else if (z <= 1.45d-47) then
        tmp = x * (-3.0d0)
    else if (z <= 8.8d-9) then
        tmp = y * 4.0d0
    else if (z <= 3.1d+184) then
        tmp = z * (y * (-6.0d0))
    else
        tmp = t_1
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double t_0 = y * (z * -6.0);
	double t_1 = x * (z * 6.0);
	double tmp;
	if (z <= -1.5e+237) {
		tmp = t_0;
	} else if (z <= -4.9e+150) {
		tmp = t_1;
	} else if (z <= -4.5e+93) {
		tmp = t_0;
	} else if (z <= -1.05e+14) {
		tmp = t_1;
	} else if (z <= -4e-55) {
		tmp = y * 4.0;
	} else if (z <= -3.1e-214) {
		tmp = x * -3.0;
	} else if (z <= 2.1e-297) {
		tmp = y * 4.0;
	} else if (z <= 1.45e-166) {
		tmp = x * -3.0;
	} else if (z <= 3.2e-123) {
		tmp = y * 4.0;
	} else if (z <= 1.45e-47) {
		tmp = x * -3.0;
	} else if (z <= 8.8e-9) {
		tmp = y * 4.0;
	} else if (z <= 3.1e+184) {
		tmp = z * (y * -6.0);
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z):
	t_0 = y * (z * -6.0)
	t_1 = x * (z * 6.0)
	tmp = 0
	if z <= -1.5e+237:
		tmp = t_0
	elif z <= -4.9e+150:
		tmp = t_1
	elif z <= -4.5e+93:
		tmp = t_0
	elif z <= -1.05e+14:
		tmp = t_1
	elif z <= -4e-55:
		tmp = y * 4.0
	elif z <= -3.1e-214:
		tmp = x * -3.0
	elif z <= 2.1e-297:
		tmp = y * 4.0
	elif z <= 1.45e-166:
		tmp = x * -3.0
	elif z <= 3.2e-123:
		tmp = y * 4.0
	elif z <= 1.45e-47:
		tmp = x * -3.0
	elif z <= 8.8e-9:
		tmp = y * 4.0
	elif z <= 3.1e+184:
		tmp = z * (y * -6.0)
	else:
		tmp = t_1
	return tmp
function code(x, y, z)
	t_0 = Float64(y * Float64(z * -6.0))
	t_1 = Float64(x * Float64(z * 6.0))
	tmp = 0.0
	if (z <= -1.5e+237)
		tmp = t_0;
	elseif (z <= -4.9e+150)
		tmp = t_1;
	elseif (z <= -4.5e+93)
		tmp = t_0;
	elseif (z <= -1.05e+14)
		tmp = t_1;
	elseif (z <= -4e-55)
		tmp = Float64(y * 4.0);
	elseif (z <= -3.1e-214)
		tmp = Float64(x * -3.0);
	elseif (z <= 2.1e-297)
		tmp = Float64(y * 4.0);
	elseif (z <= 1.45e-166)
		tmp = Float64(x * -3.0);
	elseif (z <= 3.2e-123)
		tmp = Float64(y * 4.0);
	elseif (z <= 1.45e-47)
		tmp = Float64(x * -3.0);
	elseif (z <= 8.8e-9)
		tmp = Float64(y * 4.0);
	elseif (z <= 3.1e+184)
		tmp = Float64(z * Float64(y * -6.0));
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	t_0 = y * (z * -6.0);
	t_1 = x * (z * 6.0);
	tmp = 0.0;
	if (z <= -1.5e+237)
		tmp = t_0;
	elseif (z <= -4.9e+150)
		tmp = t_1;
	elseif (z <= -4.5e+93)
		tmp = t_0;
	elseif (z <= -1.05e+14)
		tmp = t_1;
	elseif (z <= -4e-55)
		tmp = y * 4.0;
	elseif (z <= -3.1e-214)
		tmp = x * -3.0;
	elseif (z <= 2.1e-297)
		tmp = y * 4.0;
	elseif (z <= 1.45e-166)
		tmp = x * -3.0;
	elseif (z <= 3.2e-123)
		tmp = y * 4.0;
	elseif (z <= 1.45e-47)
		tmp = x * -3.0;
	elseif (z <= 8.8e-9)
		tmp = y * 4.0;
	elseif (z <= 3.1e+184)
		tmp = z * (y * -6.0);
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := Block[{t$95$0 = N[(y * N[(z * -6.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x * N[(z * 6.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.5e+237], t$95$0, If[LessEqual[z, -4.9e+150], t$95$1, If[LessEqual[z, -4.5e+93], t$95$0, If[LessEqual[z, -1.05e+14], t$95$1, If[LessEqual[z, -4e-55], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, -3.1e-214], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 2.1e-297], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 1.45e-166], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 3.2e-123], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 1.45e-47], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 8.8e-9], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 3.1e+184], N[(z * N[(y * -6.0), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]]]]]]]]]]
\begin{array}{l}

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

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

\mathbf{elif}\;z \leq -4.5 \cdot 10^{+93}:\\
\;\;\;\;t\_0\\

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

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

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

\mathbf{elif}\;z \leq 2.1 \cdot 10^{-297}:\\
\;\;\;\;y \cdot 4\\

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

\mathbf{elif}\;z \leq 3.2 \cdot 10^{-123}:\\
\;\;\;\;y \cdot 4\\

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

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

\mathbf{elif}\;z \leq 3.1 \cdot 10^{+184}:\\
\;\;\;\;z \cdot \left(y \cdot -6\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if z < -1.5e237 or -4.90000000000000007e150 < z < -4.49999999999999991e93

    1. Initial program 99.8%

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

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

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

        \[\leadsto \color{blue}{\frac{x \cdot x - \left(\left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right)\right) \cdot \left(\left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right)\right)}{x - \left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right)}} \]
      2. div-inv25.9%

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

        \[\leadsto \left(\color{blue}{{x}^{2}} - \left(\left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right)\right) \cdot \left(\left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right)\right)\right) \cdot \frac{1}{x - \left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right)} \]
      4. pow225.9%

        \[\leadsto \left({x}^{2} - \color{blue}{{\left(\left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right)\right)}^{2}}\right) \cdot \frac{1}{x - \left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right)} \]
      5. associate-*l*25.9%

        \[\leadsto \left({x}^{2} - {\color{blue}{\left(\left(y - x\right) \cdot \left(6 \cdot \left(0.6666666666666666 - z\right)\right)\right)}}^{2}\right) \cdot \frac{1}{x - \left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right)} \]
      6. associate-*l*26.0%

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

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

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

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

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

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

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

    if -1.5e237 < z < -4.90000000000000007e150 or -4.49999999999999991e93 < z < -1.05e14 or 3.0999999999999998e184 < z

    1. Initial program 99.8%

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

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

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

      \[\leadsto \color{blue}{x \cdot \left(1 + -6 \cdot \left(0.6666666666666666 - z\right)\right)} \]
    6. Step-by-step derivation
      1. sub-neg64.0%

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

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

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

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

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

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

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

        \[\leadsto x \cdot \left(\color{blue}{-3} + \left(-z \cdot -6\right)\right) \]
      9. distribute-rgt-neg-in64.0%

        \[\leadsto x \cdot \left(-3 + \color{blue}{z \cdot \left(--6\right)}\right) \]
      10. metadata-eval64.0%

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

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

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

    if -1.05e14 < z < -3.99999999999999998e-55 or -3.10000000000000004e-214 < z < 2.10000000000000013e-297 or 1.45e-166 < z < 3.19999999999999979e-123 or 1.45e-47 < z < 8.7999999999999994e-9

    1. Initial program 99.5%

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

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

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

        \[\leadsto \color{blue}{\frac{x \cdot x - \left(\left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right)\right) \cdot \left(\left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right)\right)}{x - \left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right)}} \]
      2. div-inv46.8%

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

        \[\leadsto \left(\color{blue}{{x}^{2}} - \left(\left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right)\right) \cdot \left(\left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right)\right)\right) \cdot \frac{1}{x - \left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right)} \]
      4. pow246.8%

        \[\leadsto \left({x}^{2} - \color{blue}{{\left(\left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right)\right)}^{2}}\right) \cdot \frac{1}{x - \left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right)} \]
      5. associate-*l*46.8%

        \[\leadsto \left({x}^{2} - {\color{blue}{\left(\left(y - x\right) \cdot \left(6 \cdot \left(0.6666666666666666 - z\right)\right)\right)}}^{2}\right) \cdot \frac{1}{x - \left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right)} \]
      6. associate-*l*46.9%

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{y \cdot 4} \]
    13. Simplified67.1%

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

    if -3.99999999999999998e-55 < z < -3.10000000000000004e-214 or 2.10000000000000013e-297 < z < 1.45e-166 or 3.19999999999999979e-123 < z < 1.45e-47

    1. Initial program 99.5%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto x \cdot \left(\color{blue}{-3} + \left(-z \cdot -6\right)\right) \]
      9. distribute-rgt-neg-in73.7%

        \[\leadsto x \cdot \left(-3 + \color{blue}{z \cdot \left(--6\right)}\right) \]
      10. metadata-eval73.7%

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

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

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

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

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

    if 8.7999999999999994e-9 < z < 3.0999999999999998e184

    1. Initial program 99.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.5 \cdot 10^{+237}:\\ \;\;\;\;y \cdot \left(z \cdot -6\right)\\ \mathbf{elif}\;z \leq -4.9 \cdot 10^{+150}:\\ \;\;\;\;x \cdot \left(z \cdot 6\right)\\ \mathbf{elif}\;z \leq -4.5 \cdot 10^{+93}:\\ \;\;\;\;y \cdot \left(z \cdot -6\right)\\ \mathbf{elif}\;z \leq -1.05 \cdot 10^{+14}:\\ \;\;\;\;x \cdot \left(z \cdot 6\right)\\ \mathbf{elif}\;z \leq -4 \cdot 10^{-55}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq -3.1 \cdot 10^{-214}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 2.1 \cdot 10^{-297}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 1.45 \cdot 10^{-166}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 3.2 \cdot 10^{-123}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 1.45 \cdot 10^{-47}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 8.8 \cdot 10^{-9}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 3.1 \cdot 10^{+184}:\\ \;\;\;\;z \cdot \left(y \cdot -6\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(z \cdot 6\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 74.4% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := 6 \cdot \left(y \cdot \left(0.6666666666666666 - z\right)\right)\\ t_1 := -6 \cdot \left(\left(y - x\right) \cdot z\right)\\ \mathbf{if}\;z \leq -1.05 \cdot 10^{+14}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq -1.8 \cdot 10^{-83}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;z \leq -5.3 \cdot 10^{-214}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 6 \cdot 10^{-297}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 6.3 \cdot 10^{-168}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 1.8 \cdot 10^{-126}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 6.3 \cdot 10^{-50}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 12500000:\\ \;\;\;\;t\_0\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (let* ((t_0 (* 6.0 (* y (- 0.6666666666666666 z))))
        (t_1 (* -6.0 (* (- y x) z))))
   (if (<= z -1.05e+14)
     t_1
     (if (<= z -1.8e-83)
       t_0
       (if (<= z -5.3e-214)
         (* x -3.0)
         (if (<= z 6e-297)
           (* y 4.0)
           (if (<= z 6.3e-168)
             (* x -3.0)
             (if (<= z 1.8e-126)
               (* y 4.0)
               (if (<= z 6.3e-50)
                 (* x -3.0)
                 (if (<= z 12500000.0) t_0 t_1))))))))))
double code(double x, double y, double z) {
	double t_0 = 6.0 * (y * (0.6666666666666666 - z));
	double t_1 = -6.0 * ((y - x) * z);
	double tmp;
	if (z <= -1.05e+14) {
		tmp = t_1;
	} else if (z <= -1.8e-83) {
		tmp = t_0;
	} else if (z <= -5.3e-214) {
		tmp = x * -3.0;
	} else if (z <= 6e-297) {
		tmp = y * 4.0;
	} else if (z <= 6.3e-168) {
		tmp = x * -3.0;
	} else if (z <= 1.8e-126) {
		tmp = y * 4.0;
	} else if (z <= 6.3e-50) {
		tmp = x * -3.0;
	} else if (z <= 12500000.0) {
		tmp = t_0;
	} else {
		tmp = t_1;
	}
	return tmp;
}
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8) :: t_0
    real(8) :: t_1
    real(8) :: tmp
    t_0 = 6.0d0 * (y * (0.6666666666666666d0 - z))
    t_1 = (-6.0d0) * ((y - x) * z)
    if (z <= (-1.05d+14)) then
        tmp = t_1
    else if (z <= (-1.8d-83)) then
        tmp = t_0
    else if (z <= (-5.3d-214)) then
        tmp = x * (-3.0d0)
    else if (z <= 6d-297) then
        tmp = y * 4.0d0
    else if (z <= 6.3d-168) then
        tmp = x * (-3.0d0)
    else if (z <= 1.8d-126) then
        tmp = y * 4.0d0
    else if (z <= 6.3d-50) then
        tmp = x * (-3.0d0)
    else if (z <= 12500000.0d0) then
        tmp = t_0
    else
        tmp = t_1
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double t_0 = 6.0 * (y * (0.6666666666666666 - z));
	double t_1 = -6.0 * ((y - x) * z);
	double tmp;
	if (z <= -1.05e+14) {
		tmp = t_1;
	} else if (z <= -1.8e-83) {
		tmp = t_0;
	} else if (z <= -5.3e-214) {
		tmp = x * -3.0;
	} else if (z <= 6e-297) {
		tmp = y * 4.0;
	} else if (z <= 6.3e-168) {
		tmp = x * -3.0;
	} else if (z <= 1.8e-126) {
		tmp = y * 4.0;
	} else if (z <= 6.3e-50) {
		tmp = x * -3.0;
	} else if (z <= 12500000.0) {
		tmp = t_0;
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z):
	t_0 = 6.0 * (y * (0.6666666666666666 - z))
	t_1 = -6.0 * ((y - x) * z)
	tmp = 0
	if z <= -1.05e+14:
		tmp = t_1
	elif z <= -1.8e-83:
		tmp = t_0
	elif z <= -5.3e-214:
		tmp = x * -3.0
	elif z <= 6e-297:
		tmp = y * 4.0
	elif z <= 6.3e-168:
		tmp = x * -3.0
	elif z <= 1.8e-126:
		tmp = y * 4.0
	elif z <= 6.3e-50:
		tmp = x * -3.0
	elif z <= 12500000.0:
		tmp = t_0
	else:
		tmp = t_1
	return tmp
function code(x, y, z)
	t_0 = Float64(6.0 * Float64(y * Float64(0.6666666666666666 - z)))
	t_1 = Float64(-6.0 * Float64(Float64(y - x) * z))
	tmp = 0.0
	if (z <= -1.05e+14)
		tmp = t_1;
	elseif (z <= -1.8e-83)
		tmp = t_0;
	elseif (z <= -5.3e-214)
		tmp = Float64(x * -3.0);
	elseif (z <= 6e-297)
		tmp = Float64(y * 4.0);
	elseif (z <= 6.3e-168)
		tmp = Float64(x * -3.0);
	elseif (z <= 1.8e-126)
		tmp = Float64(y * 4.0);
	elseif (z <= 6.3e-50)
		tmp = Float64(x * -3.0);
	elseif (z <= 12500000.0)
		tmp = t_0;
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	t_0 = 6.0 * (y * (0.6666666666666666 - z));
	t_1 = -6.0 * ((y - x) * z);
	tmp = 0.0;
	if (z <= -1.05e+14)
		tmp = t_1;
	elseif (z <= -1.8e-83)
		tmp = t_0;
	elseif (z <= -5.3e-214)
		tmp = x * -3.0;
	elseif (z <= 6e-297)
		tmp = y * 4.0;
	elseif (z <= 6.3e-168)
		tmp = x * -3.0;
	elseif (z <= 1.8e-126)
		tmp = y * 4.0;
	elseif (z <= 6.3e-50)
		tmp = x * -3.0;
	elseif (z <= 12500000.0)
		tmp = t_0;
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := Block[{t$95$0 = N[(6.0 * N[(y * N[(0.6666666666666666 - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(-6.0 * N[(N[(y - x), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.05e+14], t$95$1, If[LessEqual[z, -1.8e-83], t$95$0, If[LessEqual[z, -5.3e-214], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 6e-297], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 6.3e-168], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 1.8e-126], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 6.3e-50], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 12500000.0], t$95$0, t$95$1]]]]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;z \leq -1.8 \cdot 10^{-83}:\\
\;\;\;\;t\_0\\

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

\mathbf{elif}\;z \leq 6 \cdot 10^{-297}:\\
\;\;\;\;y \cdot 4\\

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -1.05e14 or 1.25e7 < z

    1. Initial program 99.8%

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

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

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

        \[\leadsto \color{blue}{\frac{x \cdot x - \left(\left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right)\right) \cdot \left(\left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right)\right)}{x - \left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right)}} \]
      2. div-inv19.2%

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

        \[\leadsto \left(\color{blue}{{x}^{2}} - \left(\left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right)\right) \cdot \left(\left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right)\right)\right) \cdot \frac{1}{x - \left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right)} \]
      4. pow219.2%

        \[\leadsto \left({x}^{2} - \color{blue}{{\left(\left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right)\right)}^{2}}\right) \cdot \frac{1}{x - \left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right)} \]
      5. associate-*l*19.1%

        \[\leadsto \left({x}^{2} - {\color{blue}{\left(\left(y - x\right) \cdot \left(6 \cdot \left(0.6666666666666666 - z\right)\right)\right)}}^{2}\right) \cdot \frac{1}{x - \left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right)} \]
      6. associate-*l*19.2%

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

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

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

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

    if -1.05e14 < z < -1.80000000000000006e-83 or 6.30000000000000023e-50 < z < 1.25e7

    1. Initial program 99.6%

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

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

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

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

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

    if -1.80000000000000006e-83 < z < -5.30000000000000005e-214 or 5.9999999999999999e-297 < z < 6.29999999999999958e-168 or 1.8e-126 < z < 6.30000000000000023e-50

    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. Add Preprocessing
    5. Taylor expanded in x around inf 76.0%

      \[\leadsto \color{blue}{x \cdot \left(1 + -6 \cdot \left(0.6666666666666666 - z\right)\right)} \]
    6. Step-by-step derivation
      1. sub-neg76.0%

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

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

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

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

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

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

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

        \[\leadsto x \cdot \left(\color{blue}{-3} + \left(-z \cdot -6\right)\right) \]
      9. distribute-rgt-neg-in76.0%

        \[\leadsto x \cdot \left(-3 + \color{blue}{z \cdot \left(--6\right)}\right) \]
      10. metadata-eval76.0%

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

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

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

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

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

    if -5.30000000000000005e-214 < z < 5.9999999999999999e-297 or 6.29999999999999958e-168 < z < 1.8e-126

    1. Initial program 99.6%

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

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

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

        \[\leadsto \color{blue}{\frac{x \cdot x - \left(\left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right)\right) \cdot \left(\left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right)\right)}{x - \left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right)}} \]
      2. div-inv48.0%

        \[\leadsto \color{blue}{\left(x \cdot x - \left(\left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right)\right) \cdot \left(\left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right)\right)\right) \cdot \frac{1}{x - \left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right)}} \]
      3. pow248.0%

        \[\leadsto \left(\color{blue}{{x}^{2}} - \left(\left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right)\right) \cdot \left(\left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right)\right)\right) \cdot \frac{1}{x - \left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right)} \]
      4. pow248.0%

        \[\leadsto \left({x}^{2} - \color{blue}{{\left(\left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right)\right)}^{2}}\right) \cdot \frac{1}{x - \left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right)} \]
      5. associate-*l*48.0%

        \[\leadsto \left({x}^{2} - {\color{blue}{\left(\left(y - x\right) \cdot \left(6 \cdot \left(0.6666666666666666 - z\right)\right)\right)}}^{2}\right) \cdot \frac{1}{x - \left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right)} \]
      6. associate-*l*48.1%

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{y \cdot 4} \]
    13. Simplified72.3%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.05 \cdot 10^{+14}:\\ \;\;\;\;-6 \cdot \left(\left(y - x\right) \cdot z\right)\\ \mathbf{elif}\;z \leq -1.8 \cdot 10^{-83}:\\ \;\;\;\;6 \cdot \left(y \cdot \left(0.6666666666666666 - z\right)\right)\\ \mathbf{elif}\;z \leq -5.3 \cdot 10^{-214}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 6 \cdot 10^{-297}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 6.3 \cdot 10^{-168}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 1.8 \cdot 10^{-126}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 6.3 \cdot 10^{-50}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 12500000:\\ \;\;\;\;6 \cdot \left(y \cdot \left(0.6666666666666666 - z\right)\right)\\ \mathbf{else}:\\ \;\;\;\;-6 \cdot \left(\left(y - x\right) \cdot z\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 8: 73.8% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := -6 \cdot \left(\left(y - x\right) \cdot z\right)\\ \mathbf{if}\;z \leq -6.6 \cdot 10^{-9}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;z \leq -2.7 \cdot 10^{-214}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 1.05 \cdot 10^{-298}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 2.9 \cdot 10^{-166}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 4.5 \cdot 10^{-124}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 4.1 \cdot 10^{-57}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 0.62:\\ \;\;\;\;y \cdot 4\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (let* ((t_0 (* -6.0 (* (- y x) z))))
   (if (<= z -6.6e-9)
     t_0
     (if (<= z -2.7e-214)
       (* x -3.0)
       (if (<= z 1.05e-298)
         (* y 4.0)
         (if (<= z 2.9e-166)
           (* x -3.0)
           (if (<= z 4.5e-124)
             (* y 4.0)
             (if (<= z 4.1e-57)
               (* x -3.0)
               (if (<= z 0.62) (* y 4.0) t_0)))))))))
double code(double x, double y, double z) {
	double t_0 = -6.0 * ((y - x) * z);
	double tmp;
	if (z <= -6.6e-9) {
		tmp = t_0;
	} else if (z <= -2.7e-214) {
		tmp = x * -3.0;
	} else if (z <= 1.05e-298) {
		tmp = y * 4.0;
	} else if (z <= 2.9e-166) {
		tmp = x * -3.0;
	} else if (z <= 4.5e-124) {
		tmp = y * 4.0;
	} else if (z <= 4.1e-57) {
		tmp = x * -3.0;
	} else if (z <= 0.62) {
		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) * ((y - x) * z)
    if (z <= (-6.6d-9)) then
        tmp = t_0
    else if (z <= (-2.7d-214)) then
        tmp = x * (-3.0d0)
    else if (z <= 1.05d-298) then
        tmp = y * 4.0d0
    else if (z <= 2.9d-166) then
        tmp = x * (-3.0d0)
    else if (z <= 4.5d-124) then
        tmp = y * 4.0d0
    else if (z <= 4.1d-57) then
        tmp = x * (-3.0d0)
    else if (z <= 0.62d0) 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 * ((y - x) * z);
	double tmp;
	if (z <= -6.6e-9) {
		tmp = t_0;
	} else if (z <= -2.7e-214) {
		tmp = x * -3.0;
	} else if (z <= 1.05e-298) {
		tmp = y * 4.0;
	} else if (z <= 2.9e-166) {
		tmp = x * -3.0;
	} else if (z <= 4.5e-124) {
		tmp = y * 4.0;
	} else if (z <= 4.1e-57) {
		tmp = x * -3.0;
	} else if (z <= 0.62) {
		tmp = y * 4.0;
	} else {
		tmp = t_0;
	}
	return tmp;
}
def code(x, y, z):
	t_0 = -6.0 * ((y - x) * z)
	tmp = 0
	if z <= -6.6e-9:
		tmp = t_0
	elif z <= -2.7e-214:
		tmp = x * -3.0
	elif z <= 1.05e-298:
		tmp = y * 4.0
	elif z <= 2.9e-166:
		tmp = x * -3.0
	elif z <= 4.5e-124:
		tmp = y * 4.0
	elif z <= 4.1e-57:
		tmp = x * -3.0
	elif z <= 0.62:
		tmp = y * 4.0
	else:
		tmp = t_0
	return tmp
function code(x, y, z)
	t_0 = Float64(-6.0 * Float64(Float64(y - x) * z))
	tmp = 0.0
	if (z <= -6.6e-9)
		tmp = t_0;
	elseif (z <= -2.7e-214)
		tmp = Float64(x * -3.0);
	elseif (z <= 1.05e-298)
		tmp = Float64(y * 4.0);
	elseif (z <= 2.9e-166)
		tmp = Float64(x * -3.0);
	elseif (z <= 4.5e-124)
		tmp = Float64(y * 4.0);
	elseif (z <= 4.1e-57)
		tmp = Float64(x * -3.0);
	elseif (z <= 0.62)
		tmp = Float64(y * 4.0);
	else
		tmp = t_0;
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	t_0 = -6.0 * ((y - x) * z);
	tmp = 0.0;
	if (z <= -6.6e-9)
		tmp = t_0;
	elseif (z <= -2.7e-214)
		tmp = x * -3.0;
	elseif (z <= 1.05e-298)
		tmp = y * 4.0;
	elseif (z <= 2.9e-166)
		tmp = x * -3.0;
	elseif (z <= 4.5e-124)
		tmp = y * 4.0;
	elseif (z <= 4.1e-57)
		tmp = x * -3.0;
	elseif (z <= 0.62)
		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[(N[(y - x), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -6.6e-9], t$95$0, If[LessEqual[z, -2.7e-214], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 1.05e-298], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 2.9e-166], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 4.5e-124], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 4.1e-57], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 0.62], N[(y * 4.0), $MachinePrecision], t$95$0]]]]]]]]
\begin{array}{l}

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

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

\mathbf{elif}\;z \leq 1.05 \cdot 10^{-298}:\\
\;\;\;\;y \cdot 4\\

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

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

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

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

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


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

    1. Initial program 99.7%

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

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

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

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

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

        \[\leadsto \left(\color{blue}{{x}^{2}} - \left(\left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right)\right) \cdot \left(\left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right)\right)\right) \cdot \frac{1}{x - \left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right)} \]
      4. pow221.3%

        \[\leadsto \left({x}^{2} - \color{blue}{{\left(\left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right)\right)}^{2}}\right) \cdot \frac{1}{x - \left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right)} \]
      5. associate-*l*21.2%

        \[\leadsto \left({x}^{2} - {\color{blue}{\left(\left(y - x\right) \cdot \left(6 \cdot \left(0.6666666666666666 - z\right)\right)\right)}}^{2}\right) \cdot \frac{1}{x - \left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right)} \]
      6. associate-*l*21.3%

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

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

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

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

    if -6.60000000000000037e-9 < z < -2.7000000000000001e-214 or 1.05000000000000002e-298 < z < 2.9e-166 or 4.4999999999999996e-124 < z < 4.1000000000000001e-57

    1. Initial program 99.5%

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

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

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

      \[\leadsto \color{blue}{x \cdot \left(1 + -6 \cdot \left(0.6666666666666666 - z\right)\right)} \]
    6. Step-by-step derivation
      1. sub-neg71.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.7000000000000001e-214 < z < 1.05000000000000002e-298 or 2.9e-166 < z < 4.4999999999999996e-124 or 4.1000000000000001e-57 < z < 0.619999999999999996

    1. Initial program 99.6%

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

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

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

        \[\leadsto \color{blue}{\frac{x \cdot x - \left(\left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right)\right) \cdot \left(\left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right)\right)}{x - \left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right)}} \]
      2. div-inv43.0%

        \[\leadsto \color{blue}{\left(x \cdot x - \left(\left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right)\right) \cdot \left(\left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right)\right)\right) \cdot \frac{1}{x - \left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right)}} \]
      3. pow243.0%

        \[\leadsto \left(\color{blue}{{x}^{2}} - \left(\left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right)\right) \cdot \left(\left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right)\right)\right) \cdot \frac{1}{x - \left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right)} \]
      4. pow243.0%

        \[\leadsto \left({x}^{2} - \color{blue}{{\left(\left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right)\right)}^{2}}\right) \cdot \frac{1}{x - \left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right)} \]
      5. associate-*l*43.0%

        \[\leadsto \left({x}^{2} - {\color{blue}{\left(\left(y - x\right) \cdot \left(6 \cdot \left(0.6666666666666666 - z\right)\right)\right)}}^{2}\right) \cdot \frac{1}{x - \left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right)} \]
      6. associate-*l*43.1%

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

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

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

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

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

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

      \[\leadsto \color{blue}{4 \cdot y} \]
    12. Step-by-step derivation
      1. *-commutative67.7%

        \[\leadsto \color{blue}{y \cdot 4} \]
    13. Simplified67.7%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -6.6 \cdot 10^{-9}:\\ \;\;\;\;-6 \cdot \left(\left(y - x\right) \cdot z\right)\\ \mathbf{elif}\;z \leq -2.7 \cdot 10^{-214}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 1.05 \cdot 10^{-298}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 2.9 \cdot 10^{-166}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 4.5 \cdot 10^{-124}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 4.1 \cdot 10^{-57}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 0.62:\\ \;\;\;\;y \cdot 4\\ \mathbf{else}:\\ \;\;\;\;-6 \cdot \left(\left(y - x\right) \cdot z\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 9: 50.9% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := -6 \cdot \left(y \cdot z\right)\\ \mathbf{if}\;z \leq -6.6 \cdot 10^{-9}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;z \leq -3.6 \cdot 10^{-214}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 9.2 \cdot 10^{-298}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 7 \cdot 10^{-169}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 2.3 \cdot 10^{-117}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 2.8 \cdot 10^{-48}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 8.8 \cdot 10^{-9}:\\ \;\;\;\;y \cdot 4\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (let* ((t_0 (* -6.0 (* y z))))
   (if (<= z -6.6e-9)
     t_0
     (if (<= z -3.6e-214)
       (* x -3.0)
       (if (<= z 9.2e-298)
         (* y 4.0)
         (if (<= z 7e-169)
           (* x -3.0)
           (if (<= z 2.3e-117)
             (* y 4.0)
             (if (<= z 2.8e-48)
               (* x -3.0)
               (if (<= z 8.8e-9) (* y 4.0) t_0)))))))))
double code(double x, double y, double z) {
	double t_0 = -6.0 * (y * z);
	double tmp;
	if (z <= -6.6e-9) {
		tmp = t_0;
	} else if (z <= -3.6e-214) {
		tmp = x * -3.0;
	} else if (z <= 9.2e-298) {
		tmp = y * 4.0;
	} else if (z <= 7e-169) {
		tmp = x * -3.0;
	} else if (z <= 2.3e-117) {
		tmp = y * 4.0;
	} else if (z <= 2.8e-48) {
		tmp = x * -3.0;
	} else if (z <= 8.8e-9) {
		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) * (y * z)
    if (z <= (-6.6d-9)) then
        tmp = t_0
    else if (z <= (-3.6d-214)) then
        tmp = x * (-3.0d0)
    else if (z <= 9.2d-298) then
        tmp = y * 4.0d0
    else if (z <= 7d-169) then
        tmp = x * (-3.0d0)
    else if (z <= 2.3d-117) then
        tmp = y * 4.0d0
    else if (z <= 2.8d-48) then
        tmp = x * (-3.0d0)
    else if (z <= 8.8d-9) 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 * (y * z);
	double tmp;
	if (z <= -6.6e-9) {
		tmp = t_0;
	} else if (z <= -3.6e-214) {
		tmp = x * -3.0;
	} else if (z <= 9.2e-298) {
		tmp = y * 4.0;
	} else if (z <= 7e-169) {
		tmp = x * -3.0;
	} else if (z <= 2.3e-117) {
		tmp = y * 4.0;
	} else if (z <= 2.8e-48) {
		tmp = x * -3.0;
	} else if (z <= 8.8e-9) {
		tmp = y * 4.0;
	} else {
		tmp = t_0;
	}
	return tmp;
}
def code(x, y, z):
	t_0 = -6.0 * (y * z)
	tmp = 0
	if z <= -6.6e-9:
		tmp = t_0
	elif z <= -3.6e-214:
		tmp = x * -3.0
	elif z <= 9.2e-298:
		tmp = y * 4.0
	elif z <= 7e-169:
		tmp = x * -3.0
	elif z <= 2.3e-117:
		tmp = y * 4.0
	elif z <= 2.8e-48:
		tmp = x * -3.0
	elif z <= 8.8e-9:
		tmp = y * 4.0
	else:
		tmp = t_0
	return tmp
function code(x, y, z)
	t_0 = Float64(-6.0 * Float64(y * z))
	tmp = 0.0
	if (z <= -6.6e-9)
		tmp = t_0;
	elseif (z <= -3.6e-214)
		tmp = Float64(x * -3.0);
	elseif (z <= 9.2e-298)
		tmp = Float64(y * 4.0);
	elseif (z <= 7e-169)
		tmp = Float64(x * -3.0);
	elseif (z <= 2.3e-117)
		tmp = Float64(y * 4.0);
	elseif (z <= 2.8e-48)
		tmp = Float64(x * -3.0);
	elseif (z <= 8.8e-9)
		tmp = Float64(y * 4.0);
	else
		tmp = t_0;
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	t_0 = -6.0 * (y * z);
	tmp = 0.0;
	if (z <= -6.6e-9)
		tmp = t_0;
	elseif (z <= -3.6e-214)
		tmp = x * -3.0;
	elseif (z <= 9.2e-298)
		tmp = y * 4.0;
	elseif (z <= 7e-169)
		tmp = x * -3.0;
	elseif (z <= 2.3e-117)
		tmp = y * 4.0;
	elseif (z <= 2.8e-48)
		tmp = x * -3.0;
	elseif (z <= 8.8e-9)
		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[(y * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -6.6e-9], t$95$0, If[LessEqual[z, -3.6e-214], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 9.2e-298], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 7e-169], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 2.3e-117], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 2.8e-48], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 8.8e-9], N[(y * 4.0), $MachinePrecision], t$95$0]]]]]]]]
\begin{array}{l}

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

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

\mathbf{elif}\;z \leq 9.2 \cdot 10^{-298}:\\
\;\;\;\;y \cdot 4\\

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

\mathbf{elif}\;z \leq 2.3 \cdot 10^{-117}:\\
\;\;\;\;y \cdot 4\\

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

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

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


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

    1. Initial program 99.7%

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

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

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

        \[\leadsto \color{blue}{\frac{x \cdot x - \left(\left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right)\right) \cdot \left(\left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right)\right)}{x - \left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right)}} \]
      2. div-inv20.9%

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

        \[\leadsto \left(\color{blue}{{x}^{2}} - \left(\left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right)\right) \cdot \left(\left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right)\right)\right) \cdot \frac{1}{x - \left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right)} \]
      4. pow220.9%

        \[\leadsto \left({x}^{2} - \color{blue}{{\left(\left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right)\right)}^{2}}\right) \cdot \frac{1}{x - \left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right)} \]
      5. associate-*l*20.8%

        \[\leadsto \left({x}^{2} - {\color{blue}{\left(\left(y - x\right) \cdot \left(6 \cdot \left(0.6666666666666666 - z\right)\right)\right)}}^{2}\right) \cdot \frac{1}{x - \left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right)} \]
      6. associate-*l*20.9%

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

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

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

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

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

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

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

    if -6.60000000000000037e-9 < z < -3.6e-214 or 9.2000000000000003e-298 < z < 7.0000000000000006e-169 or 2.29999999999999994e-117 < z < 2.80000000000000005e-48

    1. Initial program 99.5%

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

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

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

      \[\leadsto \color{blue}{x \cdot \left(1 + -6 \cdot \left(0.6666666666666666 - z\right)\right)} \]
    6. Step-by-step derivation
      1. sub-neg71.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -3.6e-214 < z < 9.2000000000000003e-298 or 7.0000000000000006e-169 < z < 2.29999999999999994e-117 or 2.80000000000000005e-48 < z < 8.7999999999999994e-9

    1. Initial program 99.5%

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

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

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

        \[\leadsto \color{blue}{\frac{x \cdot x - \left(\left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right)\right) \cdot \left(\left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right)\right)}{x - \left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right)}} \]
      2. div-inv45.8%

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

        \[\leadsto \left(\color{blue}{{x}^{2}} - \left(\left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right)\right) \cdot \left(\left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right)\right)\right) \cdot \frac{1}{x - \left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right)} \]
      4. pow245.8%

        \[\leadsto \left({x}^{2} - \color{blue}{{\left(\left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right)\right)}^{2}}\right) \cdot \frac{1}{x - \left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right)} \]
      5. associate-*l*45.8%

        \[\leadsto \left({x}^{2} - {\color{blue}{\left(\left(y - x\right) \cdot \left(6 \cdot \left(0.6666666666666666 - z\right)\right)\right)}}^{2}\right) \cdot \frac{1}{x - \left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right)} \]
      6. associate-*l*45.9%

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{y \cdot 4} \]
    13. Simplified72.1%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -6.6 \cdot 10^{-9}:\\ \;\;\;\;-6 \cdot \left(y \cdot z\right)\\ \mathbf{elif}\;z \leq -3.6 \cdot 10^{-214}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 9.2 \cdot 10^{-298}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 7 \cdot 10^{-169}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 2.3 \cdot 10^{-117}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 2.8 \cdot 10^{-48}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 8.8 \cdot 10^{-9}:\\ \;\;\;\;y \cdot 4\\ \mathbf{else}:\\ \;\;\;\;-6 \cdot \left(y \cdot z\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 10: 99.5% accurate, 0.6× speedup?

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

\\
\left(-6 \cdot \left(\left(y - x\right) \cdot z\right) + \left(y - x\right) \cdot 8\right) + \left(x + 4 \cdot \left(x - y\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. metadata-eval99.6%

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

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

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

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

      \[\leadsto \left(\color{blue}{{x}^{2}} - \left(\left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right)\right) \cdot \left(\left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right)\right)\right) \cdot \frac{1}{x - \left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right)} \]
    4. pow235.3%

      \[\leadsto \left({x}^{2} - \color{blue}{{\left(\left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right)\right)}^{2}}\right) \cdot \frac{1}{x - \left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right)} \]
    5. associate-*l*35.2%

      \[\leadsto \left({x}^{2} - {\color{blue}{\left(\left(y - x\right) \cdot \left(6 \cdot \left(0.6666666666666666 - z\right)\right)\right)}}^{2}\right) \cdot \frac{1}{x - \left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right)} \]
    6. associate-*l*35.3%

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

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

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

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

Alternative 11: 75.9% accurate, 0.8× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -3.59999999999999978e-56 or 1e-26 < x

    1. Initial program 99.7%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto x \cdot \left(\color{blue}{-3} + \left(-z \cdot -6\right)\right) \]
      9. distribute-rgt-neg-in77.7%

        \[\leadsto x \cdot \left(-3 + \color{blue}{z \cdot \left(--6\right)}\right) \]
      10. metadata-eval77.7%

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

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

    if -3.59999999999999978e-56 < x < 1e-26

    1. Initial program 99.6%

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

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

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

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

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

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

Alternative 12: 76.0% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -7 \cdot 10^{-56} \lor \neg \left(x \leq 9.6 \cdot 10^{-27}\right):\\
\;\;\;\;x \cdot \left(-3 + z \cdot 6\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -6.9999999999999996e-56 or 9.60000000000000008e-27 < x

    1. Initial program 99.7%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto x \cdot \left(\color{blue}{-3} + \left(-z \cdot -6\right)\right) \]
      9. distribute-rgt-neg-in77.7%

        \[\leadsto x \cdot \left(-3 + \color{blue}{z \cdot \left(--6\right)}\right) \]
      10. metadata-eval77.7%

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

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

    if -6.9999999999999996e-56 < x < 9.60000000000000008e-27

    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. associate-*l*99.7%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 13: 97.8% accurate, 0.8× speedup?

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

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

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

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


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

    1. Initial program 99.7%

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

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

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

        \[\leadsto \color{blue}{\frac{x \cdot x - \left(\left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right)\right) \cdot \left(\left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right)\right)}{x - \left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right)}} \]
      2. div-inv25.5%

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

        \[\leadsto \left(\color{blue}{{x}^{2}} - \left(\left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right)\right) \cdot \left(\left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right)\right)\right) \cdot \frac{1}{x - \left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right)} \]
      4. pow225.5%

        \[\leadsto \left({x}^{2} - \color{blue}{{\left(\left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right)\right)}^{2}}\right) \cdot \frac{1}{x - \left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right)} \]
      5. associate-*l*25.5%

        \[\leadsto \left({x}^{2} - {\color{blue}{\left(\left(y - x\right) \cdot \left(6 \cdot \left(0.6666666666666666 - z\right)\right)\right)}}^{2}\right) \cdot \frac{1}{x - \left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right)} \]
      6. associate-*l*25.6%

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

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

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

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

    if -0.55000000000000004 < z < 0.599999999999999978

    1. Initial program 99.5%

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

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

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

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

    if 0.599999999999999978 < z

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 14: 97.8% accurate, 0.8× speedup?

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

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

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

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


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

    1. Initial program 99.7%

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

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

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

        \[\leadsto \color{blue}{\frac{x \cdot x - \left(\left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right)\right) \cdot \left(\left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right)\right)}{x - \left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right)}} \]
      2. div-inv25.5%

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

        \[\leadsto \left(\color{blue}{{x}^{2}} - \left(\left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right)\right) \cdot \left(\left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right)\right)\right) \cdot \frac{1}{x - \left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right)} \]
      4. pow225.5%

        \[\leadsto \left({x}^{2} - \color{blue}{{\left(\left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right)\right)}^{2}}\right) \cdot \frac{1}{x - \left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right)} \]
      5. associate-*l*25.5%

        \[\leadsto \left({x}^{2} - {\color{blue}{\left(\left(y - x\right) \cdot \left(6 \cdot \left(0.6666666666666666 - z\right)\right)\right)}}^{2}\right) \cdot \frac{1}{x - \left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right)} \]
      6. associate-*l*25.6%

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

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

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

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

    if -0.599999999999999978 < z < 0.5

    1. Initial program 99.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 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. Add Preprocessing
    5. Taylor expanded in z around inf 96.2%

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

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

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

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

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

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

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

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

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

Alternative 15: 99.5% accurate, 0.8× speedup?

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

\\
x + \left(\left(\left(y - x\right) \cdot 6\right) \cdot 0.6666666666666666 + z \cdot \left(6 \cdot \left(x - y\right)\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. metadata-eval99.6%

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

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

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

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

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

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

Alternative 16: 37.8% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.05 \cdot 10^{-63} \lor \neg \left(y \leq 1.8 \cdot 10^{+101}\right):\\
\;\;\;\;y \cdot 4\\

\mathbf{else}:\\
\;\;\;\;x \cdot -3\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -1.05e-63 or 1.80000000000000015e101 < y

    1. Initial program 99.7%

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

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

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

        \[\leadsto \color{blue}{\frac{x \cdot x - \left(\left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right)\right) \cdot \left(\left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right)\right)}{x - \left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right)}} \]
      2. div-inv20.0%

        \[\leadsto \color{blue}{\left(x \cdot x - \left(\left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right)\right) \cdot \left(\left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right)\right)\right) \cdot \frac{1}{x - \left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right)}} \]
      3. pow220.0%

        \[\leadsto \left(\color{blue}{{x}^{2}} - \left(\left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right)\right) \cdot \left(\left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right)\right)\right) \cdot \frac{1}{x - \left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right)} \]
      4. pow220.0%

        \[\leadsto \left({x}^{2} - \color{blue}{{\left(\left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right)\right)}^{2}}\right) \cdot \frac{1}{x - \left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right)} \]
      5. associate-*l*20.0%

        \[\leadsto \left({x}^{2} - {\color{blue}{\left(\left(y - x\right) \cdot \left(6 \cdot \left(0.6666666666666666 - z\right)\right)\right)}}^{2}\right) \cdot \frac{1}{x - \left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right)} \]
      6. associate-*l*20.1%

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{y \cdot 4} \]
    13. Simplified37.3%

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

    if -1.05e-63 < y < 1.80000000000000015e101

    1. Initial program 99.6%

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

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

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

      \[\leadsto \color{blue}{x \cdot \left(1 + -6 \cdot \left(0.6666666666666666 - z\right)\right)} \]
    6. Step-by-step derivation
      1. sub-neg75.6%

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

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

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

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

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

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

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

        \[\leadsto x \cdot \left(\color{blue}{-3} + \left(-z \cdot -6\right)\right) \]
      9. distribute-rgt-neg-in75.6%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.05 \cdot 10^{-63} \lor \neg \left(y \leq 1.8 \cdot 10^{+101}\right):\\ \;\;\;\;y \cdot 4\\ \mathbf{else}:\\ \;\;\;\;x \cdot -3\\ \end{array} \]
  5. Add Preprocessing

Alternative 17: 99.5% accurate, 1.2× speedup?

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

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

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

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

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

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

Alternative 18: 26.9% 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. Add Preprocessing
  5. Taylor expanded in x around inf 53.0%

    \[\leadsto \color{blue}{x \cdot \left(1 + -6 \cdot \left(0.6666666666666666 - z\right)\right)} \]
  6. Step-by-step derivation
    1. sub-neg53.0%

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

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

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

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

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

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

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

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

      \[\leadsto x \cdot \left(-3 + \color{blue}{z \cdot \left(--6\right)}\right) \]
    10. metadata-eval53.0%

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

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

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

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

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

    \[\leadsto x \cdot -3 \]
  12. Add Preprocessing

Alternative 19: 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. Add Preprocessing
  5. Taylor expanded in y around inf 48.7%

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

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

    \[\leadsto x \]
  8. Add Preprocessing

Reproduce

?
herbie shell --seed 2024031 
(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))))