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

Percentage Accurate: 99.5% → 99.7%
Time: 12.2s
Alternatives: 13
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 13 alternatives:

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

Initial Program: 99.5% accurate, 1.0× speedup?

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

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

Alternative 1: 99.7% accurate, 1.2× speedup?

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

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

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

      \[\leadsto \mathsf{+.f64}\left(x, \color{blue}{\left(\left(\left(y - x\right) \cdot 6\right) \cdot \left(\frac{2}{3} - z\right)\right)}\right) \]
    2. associate-*l*N/A

      \[\leadsto \mathsf{+.f64}\left(x, \left(\left(y - x\right) \cdot \color{blue}{\left(6 \cdot \left(\frac{2}{3} - z\right)\right)}\right)\right) \]
    3. *-lowering-*.f64N/A

      \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(\left(y - x\right), \color{blue}{\left(6 \cdot \left(\frac{2}{3} - z\right)\right)}\right)\right) \]
    4. --lowering--.f64N/A

      \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(y, x\right), \left(\color{blue}{6} \cdot \left(\frac{2}{3} - z\right)\right)\right)\right) \]
    5. sub-negN/A

      \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(y, x\right), \left(6 \cdot \left(\frac{2}{3} + \color{blue}{\left(\mathsf{neg}\left(z\right)\right)}\right)\right)\right)\right) \]
    6. distribute-lft-inN/A

      \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(y, x\right), \left(6 \cdot \frac{2}{3} + \color{blue}{6 \cdot \left(\mathsf{neg}\left(z\right)\right)}\right)\right)\right) \]
    7. *-commutativeN/A

      \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(y, x\right), \left(6 \cdot \frac{2}{3} + \left(\mathsf{neg}\left(z\right)\right) \cdot \color{blue}{6}\right)\right)\right) \]
    8. +-lowering-+.f64N/A

      \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(y, x\right), \mathsf{+.f64}\left(\left(6 \cdot \frac{2}{3}\right), \color{blue}{\left(\left(\mathsf{neg}\left(z\right)\right) \cdot 6\right)}\right)\right)\right) \]
    9. metadata-evalN/A

      \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(y, x\right), \mathsf{+.f64}\left(\left(6 \cdot \frac{2}{3}\right), \left(\left(\mathsf{neg}\left(z\right)\right) \cdot 6\right)\right)\right)\right) \]
    10. metadata-evalN/A

      \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(y, x\right), \mathsf{+.f64}\left(4, \left(\color{blue}{\left(\mathsf{neg}\left(z\right)\right)} \cdot 6\right)\right)\right)\right) \]
    11. distribute-lft-neg-outN/A

      \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(y, x\right), \mathsf{+.f64}\left(4, \left(\mathsf{neg}\left(z \cdot 6\right)\right)\right)\right)\right) \]
    12. distribute-rgt-neg-inN/A

      \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(y, x\right), \mathsf{+.f64}\left(4, \left(z \cdot \color{blue}{\left(\mathsf{neg}\left(6\right)\right)}\right)\right)\right)\right) \]
    13. metadata-evalN/A

      \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(y, x\right), \mathsf{+.f64}\left(4, \left(z \cdot -6\right)\right)\right)\right) \]
    14. metadata-evalN/A

      \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(y, x\right), \mathsf{+.f64}\left(4, \left(z \cdot \left(6 \cdot \color{blue}{-1}\right)\right)\right)\right)\right) \]
    15. *-lowering-*.f64N/A

      \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(y, x\right), \mathsf{+.f64}\left(4, \mathsf{*.f64}\left(z, \color{blue}{\left(6 \cdot -1\right)}\right)\right)\right)\right) \]
    16. metadata-eval99.8%

      \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(y, x\right), \mathsf{+.f64}\left(4, \mathsf{*.f64}\left(z, -6\right)\right)\right)\right) \]
  3. Simplified99.8%

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

Alternative 2: 50.0% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := y \cdot \left(z \cdot -6\right)\\ \mathbf{if}\;z \leq -5.2 \cdot 10^{-16}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;z \leq 3.1 \cdot 10^{-285}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 4.2 \cdot 10^{-147}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 0.56:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 5.2 \cdot 10^{+159}:\\ \;\;\;\;x \cdot \left(z \cdot 6\right)\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (let* ((t_0 (* y (* z -6.0))))
   (if (<= z -5.2e-16)
     t_0
     (if (<= z 3.1e-285)
       (* y 4.0)
       (if (<= z 4.2e-147)
         (* x -3.0)
         (if (<= z 0.56)
           (* y 4.0)
           (if (<= z 5.2e+159) (* x (* z 6.0)) t_0)))))))
double code(double x, double y, double z) {
	double t_0 = y * (z * -6.0);
	double tmp;
	if (z <= -5.2e-16) {
		tmp = t_0;
	} else if (z <= 3.1e-285) {
		tmp = y * 4.0;
	} else if (z <= 4.2e-147) {
		tmp = x * -3.0;
	} else if (z <= 0.56) {
		tmp = y * 4.0;
	} else if (z <= 5.2e+159) {
		tmp = x * (z * 6.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 = y * (z * (-6.0d0))
    if (z <= (-5.2d-16)) then
        tmp = t_0
    else if (z <= 3.1d-285) then
        tmp = y * 4.0d0
    else if (z <= 4.2d-147) then
        tmp = x * (-3.0d0)
    else if (z <= 0.56d0) then
        tmp = y * 4.0d0
    else if (z <= 5.2d+159) then
        tmp = x * (z * 6.0d0)
    else
        tmp = t_0
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double t_0 = y * (z * -6.0);
	double tmp;
	if (z <= -5.2e-16) {
		tmp = t_0;
	} else if (z <= 3.1e-285) {
		tmp = y * 4.0;
	} else if (z <= 4.2e-147) {
		tmp = x * -3.0;
	} else if (z <= 0.56) {
		tmp = y * 4.0;
	} else if (z <= 5.2e+159) {
		tmp = x * (z * 6.0);
	} else {
		tmp = t_0;
	}
	return tmp;
}
def code(x, y, z):
	t_0 = y * (z * -6.0)
	tmp = 0
	if z <= -5.2e-16:
		tmp = t_0
	elif z <= 3.1e-285:
		tmp = y * 4.0
	elif z <= 4.2e-147:
		tmp = x * -3.0
	elif z <= 0.56:
		tmp = y * 4.0
	elif z <= 5.2e+159:
		tmp = x * (z * 6.0)
	else:
		tmp = t_0
	return tmp
function code(x, y, z)
	t_0 = Float64(y * Float64(z * -6.0))
	tmp = 0.0
	if (z <= -5.2e-16)
		tmp = t_0;
	elseif (z <= 3.1e-285)
		tmp = Float64(y * 4.0);
	elseif (z <= 4.2e-147)
		tmp = Float64(x * -3.0);
	elseif (z <= 0.56)
		tmp = Float64(y * 4.0);
	elseif (z <= 5.2e+159)
		tmp = Float64(x * Float64(z * 6.0));
	else
		tmp = t_0;
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	t_0 = y * (z * -6.0);
	tmp = 0.0;
	if (z <= -5.2e-16)
		tmp = t_0;
	elseif (z <= 3.1e-285)
		tmp = y * 4.0;
	elseif (z <= 4.2e-147)
		tmp = x * -3.0;
	elseif (z <= 0.56)
		tmp = y * 4.0;
	elseif (z <= 5.2e+159)
		tmp = x * (z * 6.0);
	else
		tmp = t_0;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := Block[{t$95$0 = N[(y * N[(z * -6.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -5.2e-16], t$95$0, If[LessEqual[z, 3.1e-285], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 4.2e-147], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 0.56], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 5.2e+159], N[(x * N[(z * 6.0), $MachinePrecision]), $MachinePrecision], t$95$0]]]]]]
\begin{array}{l}

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

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -5.1999999999999997e-16 or 5.2000000000000001e159 < 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. +-lowering-+.f64N/A

        \[\leadsto \mathsf{+.f64}\left(x, \color{blue}{\left(\left(\left(y - x\right) \cdot 6\right) \cdot \left(\frac{2}{3} - z\right)\right)}\right) \]
      2. associate-*l*N/A

        \[\leadsto \mathsf{+.f64}\left(x, \left(\left(y - x\right) \cdot \color{blue}{\left(6 \cdot \left(\frac{2}{3} - z\right)\right)}\right)\right) \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(\left(y - x\right), \color{blue}{\left(6 \cdot \left(\frac{2}{3} - z\right)\right)}\right)\right) \]
      4. --lowering--.f64N/A

        \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(y, x\right), \left(\color{blue}{6} \cdot \left(\frac{2}{3} - z\right)\right)\right)\right) \]
      5. sub-negN/A

        \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(y, x\right), \left(6 \cdot \left(\frac{2}{3} + \color{blue}{\left(\mathsf{neg}\left(z\right)\right)}\right)\right)\right)\right) \]
      6. distribute-lft-inN/A

        \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(y, x\right), \left(6 \cdot \frac{2}{3} + \color{blue}{6 \cdot \left(\mathsf{neg}\left(z\right)\right)}\right)\right)\right) \]
      7. *-commutativeN/A

        \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(y, x\right), \left(6 \cdot \frac{2}{3} + \left(\mathsf{neg}\left(z\right)\right) \cdot \color{blue}{6}\right)\right)\right) \]
      8. +-lowering-+.f64N/A

        \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(y, x\right), \mathsf{+.f64}\left(\left(6 \cdot \frac{2}{3}\right), \color{blue}{\left(\left(\mathsf{neg}\left(z\right)\right) \cdot 6\right)}\right)\right)\right) \]
      9. metadata-evalN/A

        \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(y, x\right), \mathsf{+.f64}\left(\left(6 \cdot \frac{2}{3}\right), \left(\left(\mathsf{neg}\left(z\right)\right) \cdot 6\right)\right)\right)\right) \]
      10. metadata-evalN/A

        \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(y, x\right), \mathsf{+.f64}\left(4, \left(\color{blue}{\left(\mathsf{neg}\left(z\right)\right)} \cdot 6\right)\right)\right)\right) \]
      11. distribute-lft-neg-outN/A

        \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(y, x\right), \mathsf{+.f64}\left(4, \left(\mathsf{neg}\left(z \cdot 6\right)\right)\right)\right)\right) \]
      12. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(y, x\right), \mathsf{+.f64}\left(4, \left(z \cdot \color{blue}{\left(\mathsf{neg}\left(6\right)\right)}\right)\right)\right)\right) \]
      13. metadata-evalN/A

        \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(y, x\right), \mathsf{+.f64}\left(4, \left(z \cdot -6\right)\right)\right)\right) \]
      14. metadata-evalN/A

        \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(y, x\right), \mathsf{+.f64}\left(4, \left(z \cdot \left(6 \cdot \color{blue}{-1}\right)\right)\right)\right)\right) \]
      15. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(y, x\right), \mathsf{+.f64}\left(4, \mathsf{*.f64}\left(z, \color{blue}{\left(6 \cdot -1\right)}\right)\right)\right)\right) \]
      16. metadata-eval99.8%

        \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(y, x\right), \mathsf{+.f64}\left(4, \mathsf{*.f64}\left(z, -6\right)\right)\right)\right) \]
    3. Simplified99.8%

      \[\leadsto \color{blue}{x + \left(y - x\right) \cdot \left(4 + z \cdot -6\right)} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. flip3-+N/A

        \[\leadsto \mathsf{+.f64}\left(x, \left(\left(y - x\right) \cdot \frac{{4}^{3} + {\left(z \cdot -6\right)}^{3}}{\color{blue}{4 \cdot 4 + \left(\left(z \cdot -6\right) \cdot \left(z \cdot -6\right) - 4 \cdot \left(z \cdot -6\right)\right)}}\right)\right) \]
      2. clear-numN/A

        \[\leadsto \mathsf{+.f64}\left(x, \left(\left(y - x\right) \cdot \frac{1}{\color{blue}{\frac{4 \cdot 4 + \left(\left(z \cdot -6\right) \cdot \left(z \cdot -6\right) - 4 \cdot \left(z \cdot -6\right)\right)}{{4}^{3} + {\left(z \cdot -6\right)}^{3}}}}\right)\right) \]
      3. un-div-invN/A

        \[\leadsto \mathsf{+.f64}\left(x, \left(\frac{y - x}{\color{blue}{\frac{4 \cdot 4 + \left(\left(z \cdot -6\right) \cdot \left(z \cdot -6\right) - 4 \cdot \left(z \cdot -6\right)\right)}{{4}^{3} + {\left(z \cdot -6\right)}^{3}}}}\right)\right) \]
      4. /-lowering-/.f64N/A

        \[\leadsto \mathsf{+.f64}\left(x, \mathsf{/.f64}\left(\left(y - x\right), \color{blue}{\left(\frac{4 \cdot 4 + \left(\left(z \cdot -6\right) \cdot \left(z \cdot -6\right) - 4 \cdot \left(z \cdot -6\right)\right)}{{4}^{3} + {\left(z \cdot -6\right)}^{3}}\right)}\right)\right) \]
      5. --lowering--.f64N/A

        \[\leadsto \mathsf{+.f64}\left(x, \mathsf{/.f64}\left(\mathsf{\_.f64}\left(y, x\right), \left(\frac{\color{blue}{4 \cdot 4 + \left(\left(z \cdot -6\right) \cdot \left(z \cdot -6\right) - 4 \cdot \left(z \cdot -6\right)\right)}}{{4}^{3} + {\left(z \cdot -6\right)}^{3}}\right)\right)\right) \]
      6. clear-numN/A

        \[\leadsto \mathsf{+.f64}\left(x, \mathsf{/.f64}\left(\mathsf{\_.f64}\left(y, x\right), \left(\frac{1}{\color{blue}{\frac{{4}^{3} + {\left(z \cdot -6\right)}^{3}}{4 \cdot 4 + \left(\left(z \cdot -6\right) \cdot \left(z \cdot -6\right) - 4 \cdot \left(z \cdot -6\right)\right)}}}\right)\right)\right) \]
      7. flip3-+N/A

        \[\leadsto \mathsf{+.f64}\left(x, \mathsf{/.f64}\left(\mathsf{\_.f64}\left(y, x\right), \left(\frac{1}{4 + \color{blue}{z \cdot -6}}\right)\right)\right) \]
      8. /-lowering-/.f64N/A

        \[\leadsto \mathsf{+.f64}\left(x, \mathsf{/.f64}\left(\mathsf{\_.f64}\left(y, x\right), \mathsf{/.f64}\left(1, \color{blue}{\left(4 + z \cdot -6\right)}\right)\right)\right) \]
      9. +-lowering-+.f64N/A

        \[\leadsto \mathsf{+.f64}\left(x, \mathsf{/.f64}\left(\mathsf{\_.f64}\left(y, x\right), \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(4, \color{blue}{\left(z \cdot -6\right)}\right)\right)\right)\right) \]
      10. *-lowering-*.f6499.7%

        \[\leadsto \mathsf{+.f64}\left(x, \mathsf{/.f64}\left(\mathsf{\_.f64}\left(y, x\right), \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(4, \mathsf{*.f64}\left(z, \color{blue}{-6}\right)\right)\right)\right)\right) \]
    6. Applied egg-rr99.7%

      \[\leadsto x + \color{blue}{\frac{y - x}{\frac{1}{4 + z \cdot -6}}} \]
    7. Taylor expanded in x around 0

      \[\leadsto \color{blue}{y \cdot \left(4 + -6 \cdot z\right)} \]
    8. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(y, \color{blue}{\left(4 + -6 \cdot z\right)}\right) \]
      2. +-lowering-+.f64N/A

        \[\leadsto \mathsf{*.f64}\left(y, \mathsf{+.f64}\left(4, \color{blue}{\left(-6 \cdot z\right)}\right)\right) \]
      3. *-lowering-*.f6457.9%

        \[\leadsto \mathsf{*.f64}\left(y, \mathsf{+.f64}\left(4, \mathsf{*.f64}\left(-6, \color{blue}{z}\right)\right)\right) \]
    9. Simplified57.9%

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

      \[\leadsto \color{blue}{-6 \cdot \left(y \cdot z\right)} \]
    11. Step-by-step derivation
      1. associate-*r*N/A

        \[\leadsto \left(-6 \cdot y\right) \cdot \color{blue}{z} \]
      2. *-commutativeN/A

        \[\leadsto \left(y \cdot -6\right) \cdot z \]
      3. associate-*r*N/A

        \[\leadsto y \cdot \color{blue}{\left(-6 \cdot z\right)} \]
      4. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(y, \color{blue}{\left(-6 \cdot z\right)}\right) \]
      5. *-lowering-*.f6457.6%

        \[\leadsto \mathsf{*.f64}\left(y, \mathsf{*.f64}\left(-6, \color{blue}{z}\right)\right) \]
    12. Simplified57.6%

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

    if -5.1999999999999997e-16 < z < 3.1000000000000001e-285 or 4.2e-147 < z < 0.56000000000000005

    1. Initial program 99.5%

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

      \[\leadsto \color{blue}{6 \cdot \left(y \cdot \left(\frac{2}{3} - z\right)\right)} \]
    4. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(6, \color{blue}{\left(y \cdot \left(\frac{2}{3} - z\right)\right)}\right) \]
      2. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(6, \mathsf{*.f64}\left(y, \color{blue}{\left(\frac{2}{3} - z\right)}\right)\right) \]
      3. --lowering--.f6462.9%

        \[\leadsto \mathsf{*.f64}\left(6, \mathsf{*.f64}\left(y, \mathsf{\_.f64}\left(\frac{2}{3}, \color{blue}{z}\right)\right)\right) \]
    5. Simplified62.9%

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

      \[\leadsto \color{blue}{4 \cdot y} \]
    7. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto y \cdot \color{blue}{4} \]
      2. *-lowering-*.f6462.7%

        \[\leadsto \mathsf{*.f64}\left(y, \color{blue}{4}\right) \]
    8. Simplified62.7%

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

    if 3.1000000000000001e-285 < z < 4.2e-147

    1. Initial program 99.4%

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

        \[\leadsto \mathsf{+.f64}\left(x, \color{blue}{\left(\left(\left(y - x\right) \cdot 6\right) \cdot \left(\frac{2}{3} - z\right)\right)}\right) \]
      2. associate-*l*N/A

        \[\leadsto \mathsf{+.f64}\left(x, \left(\left(y - x\right) \cdot \color{blue}{\left(6 \cdot \left(\frac{2}{3} - z\right)\right)}\right)\right) \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(\left(y - x\right), \color{blue}{\left(6 \cdot \left(\frac{2}{3} - z\right)\right)}\right)\right) \]
      4. --lowering--.f64N/A

        \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(y, x\right), \left(\color{blue}{6} \cdot \left(\frac{2}{3} - z\right)\right)\right)\right) \]
      5. sub-negN/A

        \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(y, x\right), \left(6 \cdot \left(\frac{2}{3} + \color{blue}{\left(\mathsf{neg}\left(z\right)\right)}\right)\right)\right)\right) \]
      6. distribute-lft-inN/A

        \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(y, x\right), \left(6 \cdot \frac{2}{3} + \color{blue}{6 \cdot \left(\mathsf{neg}\left(z\right)\right)}\right)\right)\right) \]
      7. *-commutativeN/A

        \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(y, x\right), \left(6 \cdot \frac{2}{3} + \left(\mathsf{neg}\left(z\right)\right) \cdot \color{blue}{6}\right)\right)\right) \]
      8. +-lowering-+.f64N/A

        \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(y, x\right), \mathsf{+.f64}\left(\left(6 \cdot \frac{2}{3}\right), \color{blue}{\left(\left(\mathsf{neg}\left(z\right)\right) \cdot 6\right)}\right)\right)\right) \]
      9. metadata-evalN/A

        \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(y, x\right), \mathsf{+.f64}\left(\left(6 \cdot \frac{2}{3}\right), \left(\left(\mathsf{neg}\left(z\right)\right) \cdot 6\right)\right)\right)\right) \]
      10. metadata-evalN/A

        \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(y, x\right), \mathsf{+.f64}\left(4, \left(\color{blue}{\left(\mathsf{neg}\left(z\right)\right)} \cdot 6\right)\right)\right)\right) \]
      11. distribute-lft-neg-outN/A

        \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(y, x\right), \mathsf{+.f64}\left(4, \left(\mathsf{neg}\left(z \cdot 6\right)\right)\right)\right)\right) \]
      12. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(y, x\right), \mathsf{+.f64}\left(4, \left(z \cdot \color{blue}{\left(\mathsf{neg}\left(6\right)\right)}\right)\right)\right)\right) \]
      13. metadata-evalN/A

        \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(y, x\right), \mathsf{+.f64}\left(4, \left(z \cdot -6\right)\right)\right)\right) \]
      14. metadata-evalN/A

        \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(y, x\right), \mathsf{+.f64}\left(4, \left(z \cdot \left(6 \cdot \color{blue}{-1}\right)\right)\right)\right)\right) \]
      15. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(y, x\right), \mathsf{+.f64}\left(4, \mathsf{*.f64}\left(z, \color{blue}{\left(6 \cdot -1\right)}\right)\right)\right)\right) \]
      16. metadata-eval99.6%

        \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(y, x\right), \mathsf{+.f64}\left(4, \mathsf{*.f64}\left(z, -6\right)\right)\right)\right) \]
    3. Simplified99.6%

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

      \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(y, x\right), \color{blue}{4}\right)\right) \]
    6. Step-by-step derivation
      1. Simplified99.6%

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

        \[\leadsto \color{blue}{-3 \cdot x} \]
      3. Step-by-step derivation
        1. *-commutativeN/A

          \[\leadsto x \cdot \color{blue}{-3} \]
        2. *-lowering-*.f6463.0%

          \[\leadsto \mathsf{*.f64}\left(x, \color{blue}{-3}\right) \]
      4. Simplified63.0%

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

      if 0.56000000000000005 < z < 5.2000000000000001e159

      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. +-lowering-+.f64N/A

          \[\leadsto \mathsf{+.f64}\left(x, \color{blue}{\left(\left(\left(y - x\right) \cdot 6\right) \cdot \left(\frac{2}{3} - z\right)\right)}\right) \]
        2. associate-*l*N/A

          \[\leadsto \mathsf{+.f64}\left(x, \left(\left(y - x\right) \cdot \color{blue}{\left(6 \cdot \left(\frac{2}{3} - z\right)\right)}\right)\right) \]
        3. *-lowering-*.f64N/A

          \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(\left(y - x\right), \color{blue}{\left(6 \cdot \left(\frac{2}{3} - z\right)\right)}\right)\right) \]
        4. --lowering--.f64N/A

          \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(y, x\right), \left(\color{blue}{6} \cdot \left(\frac{2}{3} - z\right)\right)\right)\right) \]
        5. sub-negN/A

          \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(y, x\right), \left(6 \cdot \left(\frac{2}{3} + \color{blue}{\left(\mathsf{neg}\left(z\right)\right)}\right)\right)\right)\right) \]
        6. distribute-lft-inN/A

          \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(y, x\right), \left(6 \cdot \frac{2}{3} + \color{blue}{6 \cdot \left(\mathsf{neg}\left(z\right)\right)}\right)\right)\right) \]
        7. *-commutativeN/A

          \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(y, x\right), \left(6 \cdot \frac{2}{3} + \left(\mathsf{neg}\left(z\right)\right) \cdot \color{blue}{6}\right)\right)\right) \]
        8. +-lowering-+.f64N/A

          \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(y, x\right), \mathsf{+.f64}\left(\left(6 \cdot \frac{2}{3}\right), \color{blue}{\left(\left(\mathsf{neg}\left(z\right)\right) \cdot 6\right)}\right)\right)\right) \]
        9. metadata-evalN/A

          \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(y, x\right), \mathsf{+.f64}\left(\left(6 \cdot \frac{2}{3}\right), \left(\left(\mathsf{neg}\left(z\right)\right) \cdot 6\right)\right)\right)\right) \]
        10. metadata-evalN/A

          \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(y, x\right), \mathsf{+.f64}\left(4, \left(\color{blue}{\left(\mathsf{neg}\left(z\right)\right)} \cdot 6\right)\right)\right)\right) \]
        11. distribute-lft-neg-outN/A

          \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(y, x\right), \mathsf{+.f64}\left(4, \left(\mathsf{neg}\left(z \cdot 6\right)\right)\right)\right)\right) \]
        12. distribute-rgt-neg-inN/A

          \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(y, x\right), \mathsf{+.f64}\left(4, \left(z \cdot \color{blue}{\left(\mathsf{neg}\left(6\right)\right)}\right)\right)\right)\right) \]
        13. metadata-evalN/A

          \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(y, x\right), \mathsf{+.f64}\left(4, \left(z \cdot -6\right)\right)\right)\right) \]
        14. metadata-evalN/A

          \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(y, x\right), \mathsf{+.f64}\left(4, \left(z \cdot \left(6 \cdot \color{blue}{-1}\right)\right)\right)\right)\right) \]
        15. *-lowering-*.f64N/A

          \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(y, x\right), \mathsf{+.f64}\left(4, \mathsf{*.f64}\left(z, \color{blue}{\left(6 \cdot -1\right)}\right)\right)\right)\right) \]
        16. metadata-eval99.8%

          \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(y, x\right), \mathsf{+.f64}\left(4, \mathsf{*.f64}\left(z, -6\right)\right)\right)\right) \]
      3. Simplified99.8%

        \[\leadsto \color{blue}{x + \left(y - x\right) \cdot \left(4 + z \cdot -6\right)} \]
      4. Add Preprocessing
      5. Step-by-step derivation
        1. flip3-+N/A

          \[\leadsto \mathsf{+.f64}\left(x, \left(\left(y - x\right) \cdot \frac{{4}^{3} + {\left(z \cdot -6\right)}^{3}}{\color{blue}{4 \cdot 4 + \left(\left(z \cdot -6\right) \cdot \left(z \cdot -6\right) - 4 \cdot \left(z \cdot -6\right)\right)}}\right)\right) \]
        2. clear-numN/A

          \[\leadsto \mathsf{+.f64}\left(x, \left(\left(y - x\right) \cdot \frac{1}{\color{blue}{\frac{4 \cdot 4 + \left(\left(z \cdot -6\right) \cdot \left(z \cdot -6\right) - 4 \cdot \left(z \cdot -6\right)\right)}{{4}^{3} + {\left(z \cdot -6\right)}^{3}}}}\right)\right) \]
        3. un-div-invN/A

          \[\leadsto \mathsf{+.f64}\left(x, \left(\frac{y - x}{\color{blue}{\frac{4 \cdot 4 + \left(\left(z \cdot -6\right) \cdot \left(z \cdot -6\right) - 4 \cdot \left(z \cdot -6\right)\right)}{{4}^{3} + {\left(z \cdot -6\right)}^{3}}}}\right)\right) \]
        4. /-lowering-/.f64N/A

          \[\leadsto \mathsf{+.f64}\left(x, \mathsf{/.f64}\left(\left(y - x\right), \color{blue}{\left(\frac{4 \cdot 4 + \left(\left(z \cdot -6\right) \cdot \left(z \cdot -6\right) - 4 \cdot \left(z \cdot -6\right)\right)}{{4}^{3} + {\left(z \cdot -6\right)}^{3}}\right)}\right)\right) \]
        5. --lowering--.f64N/A

          \[\leadsto \mathsf{+.f64}\left(x, \mathsf{/.f64}\left(\mathsf{\_.f64}\left(y, x\right), \left(\frac{\color{blue}{4 \cdot 4 + \left(\left(z \cdot -6\right) \cdot \left(z \cdot -6\right) - 4 \cdot \left(z \cdot -6\right)\right)}}{{4}^{3} + {\left(z \cdot -6\right)}^{3}}\right)\right)\right) \]
        6. clear-numN/A

          \[\leadsto \mathsf{+.f64}\left(x, \mathsf{/.f64}\left(\mathsf{\_.f64}\left(y, x\right), \left(\frac{1}{\color{blue}{\frac{{4}^{3} + {\left(z \cdot -6\right)}^{3}}{4 \cdot 4 + \left(\left(z \cdot -6\right) \cdot \left(z \cdot -6\right) - 4 \cdot \left(z \cdot -6\right)\right)}}}\right)\right)\right) \]
        7. flip3-+N/A

          \[\leadsto \mathsf{+.f64}\left(x, \mathsf{/.f64}\left(\mathsf{\_.f64}\left(y, x\right), \left(\frac{1}{4 + \color{blue}{z \cdot -6}}\right)\right)\right) \]
        8. /-lowering-/.f64N/A

          \[\leadsto \mathsf{+.f64}\left(x, \mathsf{/.f64}\left(\mathsf{\_.f64}\left(y, x\right), \mathsf{/.f64}\left(1, \color{blue}{\left(4 + z \cdot -6\right)}\right)\right)\right) \]
        9. +-lowering-+.f64N/A

          \[\leadsto \mathsf{+.f64}\left(x, \mathsf{/.f64}\left(\mathsf{\_.f64}\left(y, x\right), \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(4, \color{blue}{\left(z \cdot -6\right)}\right)\right)\right)\right) \]
        10. *-lowering-*.f6499.6%

          \[\leadsto \mathsf{+.f64}\left(x, \mathsf{/.f64}\left(\mathsf{\_.f64}\left(y, x\right), \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(4, \mathsf{*.f64}\left(z, \color{blue}{-6}\right)\right)\right)\right)\right) \]
      6. Applied egg-rr99.6%

        \[\leadsto x + \color{blue}{\frac{y - x}{\frac{1}{4 + z \cdot -6}}} \]
      7. Taylor expanded in z around inf

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

          \[\leadsto \mathsf{*.f64}\left(-6, \color{blue}{\left(z \cdot \left(y - x\right)\right)}\right) \]
        2. *-lowering-*.f64N/A

          \[\leadsto \mathsf{*.f64}\left(-6, \mathsf{*.f64}\left(z, \color{blue}{\left(y - x\right)}\right)\right) \]
        3. --lowering--.f6498.0%

          \[\leadsto \mathsf{*.f64}\left(-6, \mathsf{*.f64}\left(z, \mathsf{\_.f64}\left(y, \color{blue}{x}\right)\right)\right) \]
      9. Simplified98.0%

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

        \[\leadsto \color{blue}{6 \cdot \left(x \cdot z\right)} \]
      11. Step-by-step derivation
        1. *-commutativeN/A

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

          \[\leadsto x \cdot \color{blue}{\left(z \cdot 6\right)} \]
        3. *-commutativeN/A

          \[\leadsto x \cdot \left(6 \cdot \color{blue}{z}\right) \]
        4. *-lowering-*.f64N/A

          \[\leadsto \mathsf{*.f64}\left(x, \color{blue}{\left(6 \cdot z\right)}\right) \]
        5. *-commutativeN/A

          \[\leadsto \mathsf{*.f64}\left(x, \left(z \cdot \color{blue}{6}\right)\right) \]
        6. *-lowering-*.f6460.5%

          \[\leadsto \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(z, \color{blue}{6}\right)\right) \]
      12. Simplified60.5%

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

      \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -5.2 \cdot 10^{-16}:\\ \;\;\;\;y \cdot \left(z \cdot -6\right)\\ \mathbf{elif}\;z \leq 3.1 \cdot 10^{-285}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 4.2 \cdot 10^{-147}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 0.56:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 5.2 \cdot 10^{+159}:\\ \;\;\;\;x \cdot \left(z \cdot 6\right)\\ \mathbf{else}:\\ \;\;\;\;y \cdot \left(z \cdot -6\right)\\ \end{array} \]
    9. Add Preprocessing

    Alternative 3: 50.0% accurate, 0.4× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} t_0 := -6 \cdot \left(y \cdot z\right)\\ \mathbf{if}\;z \leq -5.2 \cdot 10^{-16}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;z \leq 1.25 \cdot 10^{-284}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 6.1 \cdot 10^{-148}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 0.5:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 2.25 \cdot 10^{+154}:\\ \;\;\;\;x \cdot \left(z \cdot 6\right)\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
    (FPCore (x y z)
     :precision binary64
     (let* ((t_0 (* -6.0 (* y z))))
       (if (<= z -5.2e-16)
         t_0
         (if (<= z 1.25e-284)
           (* y 4.0)
           (if (<= z 6.1e-148)
             (* x -3.0)
             (if (<= z 0.5)
               (* y 4.0)
               (if (<= z 2.25e+154) (* x (* z 6.0)) t_0)))))))
    double code(double x, double y, double z) {
    	double t_0 = -6.0 * (y * z);
    	double tmp;
    	if (z <= -5.2e-16) {
    		tmp = t_0;
    	} else if (z <= 1.25e-284) {
    		tmp = y * 4.0;
    	} else if (z <= 6.1e-148) {
    		tmp = x * -3.0;
    	} else if (z <= 0.5) {
    		tmp = y * 4.0;
    	} else if (z <= 2.25e+154) {
    		tmp = x * (z * 6.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 <= (-5.2d-16)) then
            tmp = t_0
        else if (z <= 1.25d-284) then
            tmp = y * 4.0d0
        else if (z <= 6.1d-148) then
            tmp = x * (-3.0d0)
        else if (z <= 0.5d0) then
            tmp = y * 4.0d0
        else if (z <= 2.25d+154) then
            tmp = x * (z * 6.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 <= -5.2e-16) {
    		tmp = t_0;
    	} else if (z <= 1.25e-284) {
    		tmp = y * 4.0;
    	} else if (z <= 6.1e-148) {
    		tmp = x * -3.0;
    	} else if (z <= 0.5) {
    		tmp = y * 4.0;
    	} else if (z <= 2.25e+154) {
    		tmp = x * (z * 6.0);
    	} else {
    		tmp = t_0;
    	}
    	return tmp;
    }
    
    def code(x, y, z):
    	t_0 = -6.0 * (y * z)
    	tmp = 0
    	if z <= -5.2e-16:
    		tmp = t_0
    	elif z <= 1.25e-284:
    		tmp = y * 4.0
    	elif z <= 6.1e-148:
    		tmp = x * -3.0
    	elif z <= 0.5:
    		tmp = y * 4.0
    	elif z <= 2.25e+154:
    		tmp = x * (z * 6.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 <= -5.2e-16)
    		tmp = t_0;
    	elseif (z <= 1.25e-284)
    		tmp = Float64(y * 4.0);
    	elseif (z <= 6.1e-148)
    		tmp = Float64(x * -3.0);
    	elseif (z <= 0.5)
    		tmp = Float64(y * 4.0);
    	elseif (z <= 2.25e+154)
    		tmp = Float64(x * Float64(z * 6.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 <= -5.2e-16)
    		tmp = t_0;
    	elseif (z <= 1.25e-284)
    		tmp = y * 4.0;
    	elseif (z <= 6.1e-148)
    		tmp = x * -3.0;
    	elseif (z <= 0.5)
    		tmp = y * 4.0;
    	elseif (z <= 2.25e+154)
    		tmp = x * (z * 6.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, -5.2e-16], t$95$0, If[LessEqual[z, 1.25e-284], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 6.1e-148], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 0.5], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 2.25e+154], N[(x * N[(z * 6.0), $MachinePrecision]), $MachinePrecision], t$95$0]]]]]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    t_0 := -6 \cdot \left(y \cdot z\right)\\
    \mathbf{if}\;z \leq -5.2 \cdot 10^{-16}:\\
    \;\;\;\;t\_0\\
    
    \mathbf{elif}\;z \leq 1.25 \cdot 10^{-284}:\\
    \;\;\;\;y \cdot 4\\
    
    \mathbf{elif}\;z \leq 6.1 \cdot 10^{-148}:\\
    \;\;\;\;x \cdot -3\\
    
    \mathbf{elif}\;z \leq 0.5:\\
    \;\;\;\;y \cdot 4\\
    
    \mathbf{elif}\;z \leq 2.25 \cdot 10^{+154}:\\
    \;\;\;\;x \cdot \left(z \cdot 6\right)\\
    
    \mathbf{else}:\\
    \;\;\;\;t\_0\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 4 regimes
    2. if z < -5.1999999999999997e-16 or 2.25000000000000005e154 < z

      1. Initial program 99.7%

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

        \[\leadsto \color{blue}{6 \cdot \left(y \cdot \left(\frac{2}{3} - z\right)\right)} \]
      4. Step-by-step derivation
        1. *-lowering-*.f64N/A

          \[\leadsto \mathsf{*.f64}\left(6, \color{blue}{\left(y \cdot \left(\frac{2}{3} - z\right)\right)}\right) \]
        2. *-lowering-*.f64N/A

          \[\leadsto \mathsf{*.f64}\left(6, \mathsf{*.f64}\left(y, \color{blue}{\left(\frac{2}{3} - z\right)}\right)\right) \]
        3. --lowering--.f6457.8%

          \[\leadsto \mathsf{*.f64}\left(6, \mathsf{*.f64}\left(y, \mathsf{\_.f64}\left(\frac{2}{3}, \color{blue}{z}\right)\right)\right) \]
      5. Simplified57.8%

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

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

          \[\leadsto \mathsf{*.f64}\left(-6, \color{blue}{\left(y \cdot z\right)}\right) \]
        2. *-lowering-*.f6457.5%

          \[\leadsto \mathsf{*.f64}\left(-6, \mathsf{*.f64}\left(y, \color{blue}{z}\right)\right) \]
      8. Simplified57.5%

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

      if -5.1999999999999997e-16 < z < 1.24999999999999993e-284 or 6.09999999999999976e-148 < 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. Add Preprocessing
      3. Taylor expanded in x around 0

        \[\leadsto \color{blue}{6 \cdot \left(y \cdot \left(\frac{2}{3} - z\right)\right)} \]
      4. Step-by-step derivation
        1. *-lowering-*.f64N/A

          \[\leadsto \mathsf{*.f64}\left(6, \color{blue}{\left(y \cdot \left(\frac{2}{3} - z\right)\right)}\right) \]
        2. *-lowering-*.f64N/A

          \[\leadsto \mathsf{*.f64}\left(6, \mathsf{*.f64}\left(y, \color{blue}{\left(\frac{2}{3} - z\right)}\right)\right) \]
        3. --lowering--.f6462.9%

          \[\leadsto \mathsf{*.f64}\left(6, \mathsf{*.f64}\left(y, \mathsf{\_.f64}\left(\frac{2}{3}, \color{blue}{z}\right)\right)\right) \]
      5. Simplified62.9%

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

        \[\leadsto \color{blue}{4 \cdot y} \]
      7. Step-by-step derivation
        1. *-commutativeN/A

          \[\leadsto y \cdot \color{blue}{4} \]
        2. *-lowering-*.f6462.7%

          \[\leadsto \mathsf{*.f64}\left(y, \color{blue}{4}\right) \]
      8. Simplified62.7%

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

      if 1.24999999999999993e-284 < z < 6.09999999999999976e-148

      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. +-lowering-+.f64N/A

          \[\leadsto \mathsf{+.f64}\left(x, \color{blue}{\left(\left(\left(y - x\right) \cdot 6\right) \cdot \left(\frac{2}{3} - z\right)\right)}\right) \]
        2. associate-*l*N/A

          \[\leadsto \mathsf{+.f64}\left(x, \left(\left(y - x\right) \cdot \color{blue}{\left(6 \cdot \left(\frac{2}{3} - z\right)\right)}\right)\right) \]
        3. *-lowering-*.f64N/A

          \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(\left(y - x\right), \color{blue}{\left(6 \cdot \left(\frac{2}{3} - z\right)\right)}\right)\right) \]
        4. --lowering--.f64N/A

          \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(y, x\right), \left(\color{blue}{6} \cdot \left(\frac{2}{3} - z\right)\right)\right)\right) \]
        5. sub-negN/A

          \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(y, x\right), \left(6 \cdot \left(\frac{2}{3} + \color{blue}{\left(\mathsf{neg}\left(z\right)\right)}\right)\right)\right)\right) \]
        6. distribute-lft-inN/A

          \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(y, x\right), \left(6 \cdot \frac{2}{3} + \color{blue}{6 \cdot \left(\mathsf{neg}\left(z\right)\right)}\right)\right)\right) \]
        7. *-commutativeN/A

          \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(y, x\right), \left(6 \cdot \frac{2}{3} + \left(\mathsf{neg}\left(z\right)\right) \cdot \color{blue}{6}\right)\right)\right) \]
        8. +-lowering-+.f64N/A

          \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(y, x\right), \mathsf{+.f64}\left(\left(6 \cdot \frac{2}{3}\right), \color{blue}{\left(\left(\mathsf{neg}\left(z\right)\right) \cdot 6\right)}\right)\right)\right) \]
        9. metadata-evalN/A

          \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(y, x\right), \mathsf{+.f64}\left(\left(6 \cdot \frac{2}{3}\right), \left(\left(\mathsf{neg}\left(z\right)\right) \cdot 6\right)\right)\right)\right) \]
        10. metadata-evalN/A

          \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(y, x\right), \mathsf{+.f64}\left(4, \left(\color{blue}{\left(\mathsf{neg}\left(z\right)\right)} \cdot 6\right)\right)\right)\right) \]
        11. distribute-lft-neg-outN/A

          \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(y, x\right), \mathsf{+.f64}\left(4, \left(\mathsf{neg}\left(z \cdot 6\right)\right)\right)\right)\right) \]
        12. distribute-rgt-neg-inN/A

          \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(y, x\right), \mathsf{+.f64}\left(4, \left(z \cdot \color{blue}{\left(\mathsf{neg}\left(6\right)\right)}\right)\right)\right)\right) \]
        13. metadata-evalN/A

          \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(y, x\right), \mathsf{+.f64}\left(4, \left(z \cdot -6\right)\right)\right)\right) \]
        14. metadata-evalN/A

          \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(y, x\right), \mathsf{+.f64}\left(4, \left(z \cdot \left(6 \cdot \color{blue}{-1}\right)\right)\right)\right)\right) \]
        15. *-lowering-*.f64N/A

          \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(y, x\right), \mathsf{+.f64}\left(4, \mathsf{*.f64}\left(z, \color{blue}{\left(6 \cdot -1\right)}\right)\right)\right)\right) \]
        16. metadata-eval99.6%

          \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(y, x\right), \mathsf{+.f64}\left(4, \mathsf{*.f64}\left(z, -6\right)\right)\right)\right) \]
      3. Simplified99.6%

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

        \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(y, x\right), \color{blue}{4}\right)\right) \]
      6. Step-by-step derivation
        1. Simplified99.6%

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

          \[\leadsto \color{blue}{-3 \cdot x} \]
        3. Step-by-step derivation
          1. *-commutativeN/A

            \[\leadsto x \cdot \color{blue}{-3} \]
          2. *-lowering-*.f6463.0%

            \[\leadsto \mathsf{*.f64}\left(x, \color{blue}{-3}\right) \]
        4. Simplified63.0%

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

        if 0.5 < z < 2.25000000000000005e154

        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. +-lowering-+.f64N/A

            \[\leadsto \mathsf{+.f64}\left(x, \color{blue}{\left(\left(\left(y - x\right) \cdot 6\right) \cdot \left(\frac{2}{3} - z\right)\right)}\right) \]
          2. associate-*l*N/A

            \[\leadsto \mathsf{+.f64}\left(x, \left(\left(y - x\right) \cdot \color{blue}{\left(6 \cdot \left(\frac{2}{3} - z\right)\right)}\right)\right) \]
          3. *-lowering-*.f64N/A

            \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(\left(y - x\right), \color{blue}{\left(6 \cdot \left(\frac{2}{3} - z\right)\right)}\right)\right) \]
          4. --lowering--.f64N/A

            \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(y, x\right), \left(\color{blue}{6} \cdot \left(\frac{2}{3} - z\right)\right)\right)\right) \]
          5. sub-negN/A

            \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(y, x\right), \left(6 \cdot \left(\frac{2}{3} + \color{blue}{\left(\mathsf{neg}\left(z\right)\right)}\right)\right)\right)\right) \]
          6. distribute-lft-inN/A

            \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(y, x\right), \left(6 \cdot \frac{2}{3} + \color{blue}{6 \cdot \left(\mathsf{neg}\left(z\right)\right)}\right)\right)\right) \]
          7. *-commutativeN/A

            \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(y, x\right), \left(6 \cdot \frac{2}{3} + \left(\mathsf{neg}\left(z\right)\right) \cdot \color{blue}{6}\right)\right)\right) \]
          8. +-lowering-+.f64N/A

            \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(y, x\right), \mathsf{+.f64}\left(\left(6 \cdot \frac{2}{3}\right), \color{blue}{\left(\left(\mathsf{neg}\left(z\right)\right) \cdot 6\right)}\right)\right)\right) \]
          9. metadata-evalN/A

            \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(y, x\right), \mathsf{+.f64}\left(\left(6 \cdot \frac{2}{3}\right), \left(\left(\mathsf{neg}\left(z\right)\right) \cdot 6\right)\right)\right)\right) \]
          10. metadata-evalN/A

            \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(y, x\right), \mathsf{+.f64}\left(4, \left(\color{blue}{\left(\mathsf{neg}\left(z\right)\right)} \cdot 6\right)\right)\right)\right) \]
          11. distribute-lft-neg-outN/A

            \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(y, x\right), \mathsf{+.f64}\left(4, \left(\mathsf{neg}\left(z \cdot 6\right)\right)\right)\right)\right) \]
          12. distribute-rgt-neg-inN/A

            \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(y, x\right), \mathsf{+.f64}\left(4, \left(z \cdot \color{blue}{\left(\mathsf{neg}\left(6\right)\right)}\right)\right)\right)\right) \]
          13. metadata-evalN/A

            \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(y, x\right), \mathsf{+.f64}\left(4, \left(z \cdot -6\right)\right)\right)\right) \]
          14. metadata-evalN/A

            \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(y, x\right), \mathsf{+.f64}\left(4, \left(z \cdot \left(6 \cdot \color{blue}{-1}\right)\right)\right)\right)\right) \]
          15. *-lowering-*.f64N/A

            \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(y, x\right), \mathsf{+.f64}\left(4, \mathsf{*.f64}\left(z, \color{blue}{\left(6 \cdot -1\right)}\right)\right)\right)\right) \]
          16. metadata-eval99.8%

            \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(y, x\right), \mathsf{+.f64}\left(4, \mathsf{*.f64}\left(z, -6\right)\right)\right)\right) \]
        3. Simplified99.8%

          \[\leadsto \color{blue}{x + \left(y - x\right) \cdot \left(4 + z \cdot -6\right)} \]
        4. Add Preprocessing
        5. Step-by-step derivation
          1. flip3-+N/A

            \[\leadsto \mathsf{+.f64}\left(x, \left(\left(y - x\right) \cdot \frac{{4}^{3} + {\left(z \cdot -6\right)}^{3}}{\color{blue}{4 \cdot 4 + \left(\left(z \cdot -6\right) \cdot \left(z \cdot -6\right) - 4 \cdot \left(z \cdot -6\right)\right)}}\right)\right) \]
          2. clear-numN/A

            \[\leadsto \mathsf{+.f64}\left(x, \left(\left(y - x\right) \cdot \frac{1}{\color{blue}{\frac{4 \cdot 4 + \left(\left(z \cdot -6\right) \cdot \left(z \cdot -6\right) - 4 \cdot \left(z \cdot -6\right)\right)}{{4}^{3} + {\left(z \cdot -6\right)}^{3}}}}\right)\right) \]
          3. un-div-invN/A

            \[\leadsto \mathsf{+.f64}\left(x, \left(\frac{y - x}{\color{blue}{\frac{4 \cdot 4 + \left(\left(z \cdot -6\right) \cdot \left(z \cdot -6\right) - 4 \cdot \left(z \cdot -6\right)\right)}{{4}^{3} + {\left(z \cdot -6\right)}^{3}}}}\right)\right) \]
          4. /-lowering-/.f64N/A

            \[\leadsto \mathsf{+.f64}\left(x, \mathsf{/.f64}\left(\left(y - x\right), \color{blue}{\left(\frac{4 \cdot 4 + \left(\left(z \cdot -6\right) \cdot \left(z \cdot -6\right) - 4 \cdot \left(z \cdot -6\right)\right)}{{4}^{3} + {\left(z \cdot -6\right)}^{3}}\right)}\right)\right) \]
          5. --lowering--.f64N/A

            \[\leadsto \mathsf{+.f64}\left(x, \mathsf{/.f64}\left(\mathsf{\_.f64}\left(y, x\right), \left(\frac{\color{blue}{4 \cdot 4 + \left(\left(z \cdot -6\right) \cdot \left(z \cdot -6\right) - 4 \cdot \left(z \cdot -6\right)\right)}}{{4}^{3} + {\left(z \cdot -6\right)}^{3}}\right)\right)\right) \]
          6. clear-numN/A

            \[\leadsto \mathsf{+.f64}\left(x, \mathsf{/.f64}\left(\mathsf{\_.f64}\left(y, x\right), \left(\frac{1}{\color{blue}{\frac{{4}^{3} + {\left(z \cdot -6\right)}^{3}}{4 \cdot 4 + \left(\left(z \cdot -6\right) \cdot \left(z \cdot -6\right) - 4 \cdot \left(z \cdot -6\right)\right)}}}\right)\right)\right) \]
          7. flip3-+N/A

            \[\leadsto \mathsf{+.f64}\left(x, \mathsf{/.f64}\left(\mathsf{\_.f64}\left(y, x\right), \left(\frac{1}{4 + \color{blue}{z \cdot -6}}\right)\right)\right) \]
          8. /-lowering-/.f64N/A

            \[\leadsto \mathsf{+.f64}\left(x, \mathsf{/.f64}\left(\mathsf{\_.f64}\left(y, x\right), \mathsf{/.f64}\left(1, \color{blue}{\left(4 + z \cdot -6\right)}\right)\right)\right) \]
          9. +-lowering-+.f64N/A

            \[\leadsto \mathsf{+.f64}\left(x, \mathsf{/.f64}\left(\mathsf{\_.f64}\left(y, x\right), \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(4, \color{blue}{\left(z \cdot -6\right)}\right)\right)\right)\right) \]
          10. *-lowering-*.f6499.6%

            \[\leadsto \mathsf{+.f64}\left(x, \mathsf{/.f64}\left(\mathsf{\_.f64}\left(y, x\right), \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(4, \mathsf{*.f64}\left(z, \color{blue}{-6}\right)\right)\right)\right)\right) \]
        6. Applied egg-rr99.6%

          \[\leadsto x + \color{blue}{\frac{y - x}{\frac{1}{4 + z \cdot -6}}} \]
        7. Taylor expanded in z around inf

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

            \[\leadsto \mathsf{*.f64}\left(-6, \color{blue}{\left(z \cdot \left(y - x\right)\right)}\right) \]
          2. *-lowering-*.f64N/A

            \[\leadsto \mathsf{*.f64}\left(-6, \mathsf{*.f64}\left(z, \color{blue}{\left(y - x\right)}\right)\right) \]
          3. --lowering--.f6498.0%

            \[\leadsto \mathsf{*.f64}\left(-6, \mathsf{*.f64}\left(z, \mathsf{\_.f64}\left(y, \color{blue}{x}\right)\right)\right) \]
        9. Simplified98.0%

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

          \[\leadsto \color{blue}{6 \cdot \left(x \cdot z\right)} \]
        11. Step-by-step derivation
          1. *-commutativeN/A

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

            \[\leadsto x \cdot \color{blue}{\left(z \cdot 6\right)} \]
          3. *-commutativeN/A

            \[\leadsto x \cdot \left(6 \cdot \color{blue}{z}\right) \]
          4. *-lowering-*.f64N/A

            \[\leadsto \mathsf{*.f64}\left(x, \color{blue}{\left(6 \cdot z\right)}\right) \]
          5. *-commutativeN/A

            \[\leadsto \mathsf{*.f64}\left(x, \left(z \cdot \color{blue}{6}\right)\right) \]
          6. *-lowering-*.f6460.5%

            \[\leadsto \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(z, \color{blue}{6}\right)\right) \]
        12. Simplified60.5%

          \[\leadsto \color{blue}{x \cdot \left(z \cdot 6\right)} \]
      7. Recombined 4 regimes into one program.
      8. Add Preprocessing

      Alternative 4: 73.6% accurate, 0.5× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} t_0 := -6 \cdot \left(\left(y - x\right) \cdot z\right)\\ \mathbf{if}\;z \leq -5.2 \cdot 10^{-16}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;z \leq 1.9 \cdot 10^{-288}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 3.7 \cdot 10^{-149}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 1320000:\\ \;\;\;\;6 \cdot \left(y \cdot \left(0.6666666666666666 - z\right)\right)\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
      (FPCore (x y z)
       :precision binary64
       (let* ((t_0 (* -6.0 (* (- y x) z))))
         (if (<= z -5.2e-16)
           t_0
           (if (<= z 1.9e-288)
             (* y 4.0)
             (if (<= z 3.7e-149)
               (* x -3.0)
               (if (<= z 1320000.0) (* 6.0 (* y (- 0.6666666666666666 z))) t_0))))))
      double code(double x, double y, double z) {
      	double t_0 = -6.0 * ((y - x) * z);
      	double tmp;
      	if (z <= -5.2e-16) {
      		tmp = t_0;
      	} else if (z <= 1.9e-288) {
      		tmp = y * 4.0;
      	} else if (z <= 3.7e-149) {
      		tmp = x * -3.0;
      	} else if (z <= 1320000.0) {
      		tmp = 6.0 * (y * (0.6666666666666666 - z));
      	} 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 <= (-5.2d-16)) then
              tmp = t_0
          else if (z <= 1.9d-288) then
              tmp = y * 4.0d0
          else if (z <= 3.7d-149) then
              tmp = x * (-3.0d0)
          else if (z <= 1320000.0d0) then
              tmp = 6.0d0 * (y * (0.6666666666666666d0 - z))
          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 <= -5.2e-16) {
      		tmp = t_0;
      	} else if (z <= 1.9e-288) {
      		tmp = y * 4.0;
      	} else if (z <= 3.7e-149) {
      		tmp = x * -3.0;
      	} else if (z <= 1320000.0) {
      		tmp = 6.0 * (y * (0.6666666666666666 - z));
      	} else {
      		tmp = t_0;
      	}
      	return tmp;
      }
      
      def code(x, y, z):
      	t_0 = -6.0 * ((y - x) * z)
      	tmp = 0
      	if z <= -5.2e-16:
      		tmp = t_0
      	elif z <= 1.9e-288:
      		tmp = y * 4.0
      	elif z <= 3.7e-149:
      		tmp = x * -3.0
      	elif z <= 1320000.0:
      		tmp = 6.0 * (y * (0.6666666666666666 - z))
      	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 <= -5.2e-16)
      		tmp = t_0;
      	elseif (z <= 1.9e-288)
      		tmp = Float64(y * 4.0);
      	elseif (z <= 3.7e-149)
      		tmp = Float64(x * -3.0);
      	elseif (z <= 1320000.0)
      		tmp = Float64(6.0 * Float64(y * Float64(0.6666666666666666 - z)));
      	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 <= -5.2e-16)
      		tmp = t_0;
      	elseif (z <= 1.9e-288)
      		tmp = y * 4.0;
      	elseif (z <= 3.7e-149)
      		tmp = x * -3.0;
      	elseif (z <= 1320000.0)
      		tmp = 6.0 * (y * (0.6666666666666666 - z));
      	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, -5.2e-16], t$95$0, If[LessEqual[z, 1.9e-288], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 3.7e-149], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 1320000.0], N[(6.0 * N[(y * N[(0.6666666666666666 - z), $MachinePrecision]), $MachinePrecision]), $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 -5.2 \cdot 10^{-16}:\\
      \;\;\;\;t\_0\\
      
      \mathbf{elif}\;z \leq 1.9 \cdot 10^{-288}:\\
      \;\;\;\;y \cdot 4\\
      
      \mathbf{elif}\;z \leq 3.7 \cdot 10^{-149}:\\
      \;\;\;\;x \cdot -3\\
      
      \mathbf{elif}\;z \leq 1320000:\\
      \;\;\;\;6 \cdot \left(y \cdot \left(0.6666666666666666 - z\right)\right)\\
      
      \mathbf{else}:\\
      \;\;\;\;t\_0\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 4 regimes
      2. if z < -5.1999999999999997e-16 or 1.32e6 < 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. +-lowering-+.f64N/A

            \[\leadsto \mathsf{+.f64}\left(x, \color{blue}{\left(\left(\left(y - x\right) \cdot 6\right) \cdot \left(\frac{2}{3} - z\right)\right)}\right) \]
          2. associate-*l*N/A

            \[\leadsto \mathsf{+.f64}\left(x, \left(\left(y - x\right) \cdot \color{blue}{\left(6 \cdot \left(\frac{2}{3} - z\right)\right)}\right)\right) \]
          3. *-lowering-*.f64N/A

            \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(\left(y - x\right), \color{blue}{\left(6 \cdot \left(\frac{2}{3} - z\right)\right)}\right)\right) \]
          4. --lowering--.f64N/A

            \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(y, x\right), \left(\color{blue}{6} \cdot \left(\frac{2}{3} - z\right)\right)\right)\right) \]
          5. sub-negN/A

            \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(y, x\right), \left(6 \cdot \left(\frac{2}{3} + \color{blue}{\left(\mathsf{neg}\left(z\right)\right)}\right)\right)\right)\right) \]
          6. distribute-lft-inN/A

            \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(y, x\right), \left(6 \cdot \frac{2}{3} + \color{blue}{6 \cdot \left(\mathsf{neg}\left(z\right)\right)}\right)\right)\right) \]
          7. *-commutativeN/A

            \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(y, x\right), \left(6 \cdot \frac{2}{3} + \left(\mathsf{neg}\left(z\right)\right) \cdot \color{blue}{6}\right)\right)\right) \]
          8. +-lowering-+.f64N/A

            \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(y, x\right), \mathsf{+.f64}\left(\left(6 \cdot \frac{2}{3}\right), \color{blue}{\left(\left(\mathsf{neg}\left(z\right)\right) \cdot 6\right)}\right)\right)\right) \]
          9. metadata-evalN/A

            \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(y, x\right), \mathsf{+.f64}\left(\left(6 \cdot \frac{2}{3}\right), \left(\left(\mathsf{neg}\left(z\right)\right) \cdot 6\right)\right)\right)\right) \]
          10. metadata-evalN/A

            \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(y, x\right), \mathsf{+.f64}\left(4, \left(\color{blue}{\left(\mathsf{neg}\left(z\right)\right)} \cdot 6\right)\right)\right)\right) \]
          11. distribute-lft-neg-outN/A

            \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(y, x\right), \mathsf{+.f64}\left(4, \left(\mathsf{neg}\left(z \cdot 6\right)\right)\right)\right)\right) \]
          12. distribute-rgt-neg-inN/A

            \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(y, x\right), \mathsf{+.f64}\left(4, \left(z \cdot \color{blue}{\left(\mathsf{neg}\left(6\right)\right)}\right)\right)\right)\right) \]
          13. metadata-evalN/A

            \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(y, x\right), \mathsf{+.f64}\left(4, \left(z \cdot -6\right)\right)\right)\right) \]
          14. metadata-evalN/A

            \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(y, x\right), \mathsf{+.f64}\left(4, \left(z \cdot \left(6 \cdot \color{blue}{-1}\right)\right)\right)\right)\right) \]
          15. *-lowering-*.f64N/A

            \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(y, x\right), \mathsf{+.f64}\left(4, \mathsf{*.f64}\left(z, \color{blue}{\left(6 \cdot -1\right)}\right)\right)\right)\right) \]
          16. metadata-eval99.8%

            \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(y, x\right), \mathsf{+.f64}\left(4, \mathsf{*.f64}\left(z, -6\right)\right)\right)\right) \]
        3. Simplified99.8%

          \[\leadsto \color{blue}{x + \left(y - x\right) \cdot \left(4 + z \cdot -6\right)} \]
        4. Add Preprocessing
        5. Step-by-step derivation
          1. flip3-+N/A

            \[\leadsto \mathsf{+.f64}\left(x, \left(\left(y - x\right) \cdot \frac{{4}^{3} + {\left(z \cdot -6\right)}^{3}}{\color{blue}{4 \cdot 4 + \left(\left(z \cdot -6\right) \cdot \left(z \cdot -6\right) - 4 \cdot \left(z \cdot -6\right)\right)}}\right)\right) \]
          2. clear-numN/A

            \[\leadsto \mathsf{+.f64}\left(x, \left(\left(y - x\right) \cdot \frac{1}{\color{blue}{\frac{4 \cdot 4 + \left(\left(z \cdot -6\right) \cdot \left(z \cdot -6\right) - 4 \cdot \left(z \cdot -6\right)\right)}{{4}^{3} + {\left(z \cdot -6\right)}^{3}}}}\right)\right) \]
          3. un-div-invN/A

            \[\leadsto \mathsf{+.f64}\left(x, \left(\frac{y - x}{\color{blue}{\frac{4 \cdot 4 + \left(\left(z \cdot -6\right) \cdot \left(z \cdot -6\right) - 4 \cdot \left(z \cdot -6\right)\right)}{{4}^{3} + {\left(z \cdot -6\right)}^{3}}}}\right)\right) \]
          4. /-lowering-/.f64N/A

            \[\leadsto \mathsf{+.f64}\left(x, \mathsf{/.f64}\left(\left(y - x\right), \color{blue}{\left(\frac{4 \cdot 4 + \left(\left(z \cdot -6\right) \cdot \left(z \cdot -6\right) - 4 \cdot \left(z \cdot -6\right)\right)}{{4}^{3} + {\left(z \cdot -6\right)}^{3}}\right)}\right)\right) \]
          5. --lowering--.f64N/A

            \[\leadsto \mathsf{+.f64}\left(x, \mathsf{/.f64}\left(\mathsf{\_.f64}\left(y, x\right), \left(\frac{\color{blue}{4 \cdot 4 + \left(\left(z \cdot -6\right) \cdot \left(z \cdot -6\right) - 4 \cdot \left(z \cdot -6\right)\right)}}{{4}^{3} + {\left(z \cdot -6\right)}^{3}}\right)\right)\right) \]
          6. clear-numN/A

            \[\leadsto \mathsf{+.f64}\left(x, \mathsf{/.f64}\left(\mathsf{\_.f64}\left(y, x\right), \left(\frac{1}{\color{blue}{\frac{{4}^{3} + {\left(z \cdot -6\right)}^{3}}{4 \cdot 4 + \left(\left(z \cdot -6\right) \cdot \left(z \cdot -6\right) - 4 \cdot \left(z \cdot -6\right)\right)}}}\right)\right)\right) \]
          7. flip3-+N/A

            \[\leadsto \mathsf{+.f64}\left(x, \mathsf{/.f64}\left(\mathsf{\_.f64}\left(y, x\right), \left(\frac{1}{4 + \color{blue}{z \cdot -6}}\right)\right)\right) \]
          8. /-lowering-/.f64N/A

            \[\leadsto \mathsf{+.f64}\left(x, \mathsf{/.f64}\left(\mathsf{\_.f64}\left(y, x\right), \mathsf{/.f64}\left(1, \color{blue}{\left(4 + z \cdot -6\right)}\right)\right)\right) \]
          9. +-lowering-+.f64N/A

            \[\leadsto \mathsf{+.f64}\left(x, \mathsf{/.f64}\left(\mathsf{\_.f64}\left(y, x\right), \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(4, \color{blue}{\left(z \cdot -6\right)}\right)\right)\right)\right) \]
          10. *-lowering-*.f6499.7%

            \[\leadsto \mathsf{+.f64}\left(x, \mathsf{/.f64}\left(\mathsf{\_.f64}\left(y, x\right), \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(4, \mathsf{*.f64}\left(z, \color{blue}{-6}\right)\right)\right)\right)\right) \]
        6. Applied egg-rr99.7%

          \[\leadsto x + \color{blue}{\frac{y - x}{\frac{1}{4 + z \cdot -6}}} \]
        7. Taylor expanded in z around inf

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

            \[\leadsto \mathsf{*.f64}\left(-6, \color{blue}{\left(z \cdot \left(y - x\right)\right)}\right) \]
          2. *-lowering-*.f64N/A

            \[\leadsto \mathsf{*.f64}\left(-6, \mathsf{*.f64}\left(z, \color{blue}{\left(y - x\right)}\right)\right) \]
          3. --lowering--.f6497.3%

            \[\leadsto \mathsf{*.f64}\left(-6, \mathsf{*.f64}\left(z, \mathsf{\_.f64}\left(y, \color{blue}{x}\right)\right)\right) \]
        9. Simplified97.3%

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

        if -5.1999999999999997e-16 < z < 1.8999999999999999e-288

        1. Initial program 99.4%

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

          \[\leadsto \color{blue}{6 \cdot \left(y \cdot \left(\frac{2}{3} - z\right)\right)} \]
        4. Step-by-step derivation
          1. *-lowering-*.f64N/A

            \[\leadsto \mathsf{*.f64}\left(6, \color{blue}{\left(y \cdot \left(\frac{2}{3} - z\right)\right)}\right) \]
          2. *-lowering-*.f64N/A

            \[\leadsto \mathsf{*.f64}\left(6, \mathsf{*.f64}\left(y, \color{blue}{\left(\frac{2}{3} - z\right)}\right)\right) \]
          3. --lowering--.f6460.5%

            \[\leadsto \mathsf{*.f64}\left(6, \mathsf{*.f64}\left(y, \mathsf{\_.f64}\left(\frac{2}{3}, \color{blue}{z}\right)\right)\right) \]
        5. Simplified60.5%

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

          \[\leadsto \color{blue}{4 \cdot y} \]
        7. Step-by-step derivation
          1. *-commutativeN/A

            \[\leadsto y \cdot \color{blue}{4} \]
          2. *-lowering-*.f6460.7%

            \[\leadsto \mathsf{*.f64}\left(y, \color{blue}{4}\right) \]
        8. Simplified60.7%

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

        if 1.8999999999999999e-288 < z < 3.6999999999999999e-149

        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. +-lowering-+.f64N/A

            \[\leadsto \mathsf{+.f64}\left(x, \color{blue}{\left(\left(\left(y - x\right) \cdot 6\right) \cdot \left(\frac{2}{3} - z\right)\right)}\right) \]
          2. associate-*l*N/A

            \[\leadsto \mathsf{+.f64}\left(x, \left(\left(y - x\right) \cdot \color{blue}{\left(6 \cdot \left(\frac{2}{3} - z\right)\right)}\right)\right) \]
          3. *-lowering-*.f64N/A

            \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(\left(y - x\right), \color{blue}{\left(6 \cdot \left(\frac{2}{3} - z\right)\right)}\right)\right) \]
          4. --lowering--.f64N/A

            \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(y, x\right), \left(\color{blue}{6} \cdot \left(\frac{2}{3} - z\right)\right)\right)\right) \]
          5. sub-negN/A

            \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(y, x\right), \left(6 \cdot \left(\frac{2}{3} + \color{blue}{\left(\mathsf{neg}\left(z\right)\right)}\right)\right)\right)\right) \]
          6. distribute-lft-inN/A

            \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(y, x\right), \left(6 \cdot \frac{2}{3} + \color{blue}{6 \cdot \left(\mathsf{neg}\left(z\right)\right)}\right)\right)\right) \]
          7. *-commutativeN/A

            \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(y, x\right), \left(6 \cdot \frac{2}{3} + \left(\mathsf{neg}\left(z\right)\right) \cdot \color{blue}{6}\right)\right)\right) \]
          8. +-lowering-+.f64N/A

            \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(y, x\right), \mathsf{+.f64}\left(\left(6 \cdot \frac{2}{3}\right), \color{blue}{\left(\left(\mathsf{neg}\left(z\right)\right) \cdot 6\right)}\right)\right)\right) \]
          9. metadata-evalN/A

            \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(y, x\right), \mathsf{+.f64}\left(\left(6 \cdot \frac{2}{3}\right), \left(\left(\mathsf{neg}\left(z\right)\right) \cdot 6\right)\right)\right)\right) \]
          10. metadata-evalN/A

            \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(y, x\right), \mathsf{+.f64}\left(4, \left(\color{blue}{\left(\mathsf{neg}\left(z\right)\right)} \cdot 6\right)\right)\right)\right) \]
          11. distribute-lft-neg-outN/A

            \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(y, x\right), \mathsf{+.f64}\left(4, \left(\mathsf{neg}\left(z \cdot 6\right)\right)\right)\right)\right) \]
          12. distribute-rgt-neg-inN/A

            \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(y, x\right), \mathsf{+.f64}\left(4, \left(z \cdot \color{blue}{\left(\mathsf{neg}\left(6\right)\right)}\right)\right)\right)\right) \]
          13. metadata-evalN/A

            \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(y, x\right), \mathsf{+.f64}\left(4, \left(z \cdot -6\right)\right)\right)\right) \]
          14. metadata-evalN/A

            \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(y, x\right), \mathsf{+.f64}\left(4, \left(z \cdot \left(6 \cdot \color{blue}{-1}\right)\right)\right)\right)\right) \]
          15. *-lowering-*.f64N/A

            \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(y, x\right), \mathsf{+.f64}\left(4, \mathsf{*.f64}\left(z, \color{blue}{\left(6 \cdot -1\right)}\right)\right)\right)\right) \]
          16. metadata-eval99.6%

            \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(y, x\right), \mathsf{+.f64}\left(4, \mathsf{*.f64}\left(z, -6\right)\right)\right)\right) \]
        3. Simplified99.6%

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

          \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(y, x\right), \color{blue}{4}\right)\right) \]
        6. Step-by-step derivation
          1. Simplified99.6%

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

            \[\leadsto \color{blue}{-3 \cdot x} \]
          3. Step-by-step derivation
            1. *-commutativeN/A

              \[\leadsto x \cdot \color{blue}{-3} \]
            2. *-lowering-*.f6463.0%

              \[\leadsto \mathsf{*.f64}\left(x, \color{blue}{-3}\right) \]
          4. Simplified63.0%

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

          if 3.6999999999999999e-149 < z < 1.32e6

          1. Initial program 99.7%

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

            \[\leadsto \color{blue}{6 \cdot \left(y \cdot \left(\frac{2}{3} - z\right)\right)} \]
          4. Step-by-step derivation
            1. *-lowering-*.f64N/A

              \[\leadsto \mathsf{*.f64}\left(6, \color{blue}{\left(y \cdot \left(\frac{2}{3} - z\right)\right)}\right) \]
            2. *-lowering-*.f64N/A

              \[\leadsto \mathsf{*.f64}\left(6, \mathsf{*.f64}\left(y, \color{blue}{\left(\frac{2}{3} - z\right)}\right)\right) \]
            3. --lowering--.f6469.1%

              \[\leadsto \mathsf{*.f64}\left(6, \mathsf{*.f64}\left(y, \mathsf{\_.f64}\left(\frac{2}{3}, \color{blue}{z}\right)\right)\right) \]
          5. Simplified69.1%

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

          \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -5.2 \cdot 10^{-16}:\\ \;\;\;\;-6 \cdot \left(\left(y - x\right) \cdot z\right)\\ \mathbf{elif}\;z \leq 1.9 \cdot 10^{-288}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 3.7 \cdot 10^{-149}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 1320000:\\ \;\;\;\;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} \]
        9. Add Preprocessing

        Alternative 5: 73.2% accurate, 0.5× speedup?

        \[\begin{array}{l} \\ \begin{array}{l} t_0 := -6 \cdot \left(\left(y - x\right) \cdot z\right)\\ \mathbf{if}\;z \leq -5.2 \cdot 10^{-16}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;z \leq 5.3 \cdot 10^{-289}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 9.8 \cdot 10^{-147}:\\ \;\;\;\;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 -5.2e-16)
             t_0
             (if (<= z 5.3e-289)
               (* y 4.0)
               (if (<= z 9.8e-147) (* 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 <= -5.2e-16) {
        		tmp = t_0;
        	} else if (z <= 5.3e-289) {
        		tmp = y * 4.0;
        	} else if (z <= 9.8e-147) {
        		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 <= (-5.2d-16)) then
                tmp = t_0
            else if (z <= 5.3d-289) then
                tmp = y * 4.0d0
            else if (z <= 9.8d-147) 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 <= -5.2e-16) {
        		tmp = t_0;
        	} else if (z <= 5.3e-289) {
        		tmp = y * 4.0;
        	} else if (z <= 9.8e-147) {
        		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 <= -5.2e-16:
        		tmp = t_0
        	elif z <= 5.3e-289:
        		tmp = y * 4.0
        	elif z <= 9.8e-147:
        		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 <= -5.2e-16)
        		tmp = t_0;
        	elseif (z <= 5.3e-289)
        		tmp = Float64(y * 4.0);
        	elseif (z <= 9.8e-147)
        		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 <= -5.2e-16)
        		tmp = t_0;
        	elseif (z <= 5.3e-289)
        		tmp = y * 4.0;
        	elseif (z <= 9.8e-147)
        		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, -5.2e-16], t$95$0, If[LessEqual[z, 5.3e-289], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 9.8e-147], 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 -5.2 \cdot 10^{-16}:\\
        \;\;\;\;t\_0\\
        
        \mathbf{elif}\;z \leq 5.3 \cdot 10^{-289}:\\
        \;\;\;\;y \cdot 4\\
        
        \mathbf{elif}\;z \leq 9.8 \cdot 10^{-147}:\\
        \;\;\;\;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 < -5.1999999999999997e-16 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. +-lowering-+.f64N/A

              \[\leadsto \mathsf{+.f64}\left(x, \color{blue}{\left(\left(\left(y - x\right) \cdot 6\right) \cdot \left(\frac{2}{3} - z\right)\right)}\right) \]
            2. associate-*l*N/A

              \[\leadsto \mathsf{+.f64}\left(x, \left(\left(y - x\right) \cdot \color{blue}{\left(6 \cdot \left(\frac{2}{3} - z\right)\right)}\right)\right) \]
            3. *-lowering-*.f64N/A

              \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(\left(y - x\right), \color{blue}{\left(6 \cdot \left(\frac{2}{3} - z\right)\right)}\right)\right) \]
            4. --lowering--.f64N/A

              \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(y, x\right), \left(\color{blue}{6} \cdot \left(\frac{2}{3} - z\right)\right)\right)\right) \]
            5. sub-negN/A

              \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(y, x\right), \left(6 \cdot \left(\frac{2}{3} + \color{blue}{\left(\mathsf{neg}\left(z\right)\right)}\right)\right)\right)\right) \]
            6. distribute-lft-inN/A

              \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(y, x\right), \left(6 \cdot \frac{2}{3} + \color{blue}{6 \cdot \left(\mathsf{neg}\left(z\right)\right)}\right)\right)\right) \]
            7. *-commutativeN/A

              \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(y, x\right), \left(6 \cdot \frac{2}{3} + \left(\mathsf{neg}\left(z\right)\right) \cdot \color{blue}{6}\right)\right)\right) \]
            8. +-lowering-+.f64N/A

              \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(y, x\right), \mathsf{+.f64}\left(\left(6 \cdot \frac{2}{3}\right), \color{blue}{\left(\left(\mathsf{neg}\left(z\right)\right) \cdot 6\right)}\right)\right)\right) \]
            9. metadata-evalN/A

              \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(y, x\right), \mathsf{+.f64}\left(\left(6 \cdot \frac{2}{3}\right), \left(\left(\mathsf{neg}\left(z\right)\right) \cdot 6\right)\right)\right)\right) \]
            10. metadata-evalN/A

              \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(y, x\right), \mathsf{+.f64}\left(4, \left(\color{blue}{\left(\mathsf{neg}\left(z\right)\right)} \cdot 6\right)\right)\right)\right) \]
            11. distribute-lft-neg-outN/A

              \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(y, x\right), \mathsf{+.f64}\left(4, \left(\mathsf{neg}\left(z \cdot 6\right)\right)\right)\right)\right) \]
            12. distribute-rgt-neg-inN/A

              \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(y, x\right), \mathsf{+.f64}\left(4, \left(z \cdot \color{blue}{\left(\mathsf{neg}\left(6\right)\right)}\right)\right)\right)\right) \]
            13. metadata-evalN/A

              \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(y, x\right), \mathsf{+.f64}\left(4, \left(z \cdot -6\right)\right)\right)\right) \]
            14. metadata-evalN/A

              \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(y, x\right), \mathsf{+.f64}\left(4, \left(z \cdot \left(6 \cdot \color{blue}{-1}\right)\right)\right)\right)\right) \]
            15. *-lowering-*.f64N/A

              \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(y, x\right), \mathsf{+.f64}\left(4, \mathsf{*.f64}\left(z, \color{blue}{\left(6 \cdot -1\right)}\right)\right)\right)\right) \]
            16. metadata-eval99.8%

              \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(y, x\right), \mathsf{+.f64}\left(4, \mathsf{*.f64}\left(z, -6\right)\right)\right)\right) \]
          3. Simplified99.8%

            \[\leadsto \color{blue}{x + \left(y - x\right) \cdot \left(4 + z \cdot -6\right)} \]
          4. Add Preprocessing
          5. Step-by-step derivation
            1. flip3-+N/A

              \[\leadsto \mathsf{+.f64}\left(x, \left(\left(y - x\right) \cdot \frac{{4}^{3} + {\left(z \cdot -6\right)}^{3}}{\color{blue}{4 \cdot 4 + \left(\left(z \cdot -6\right) \cdot \left(z \cdot -6\right) - 4 \cdot \left(z \cdot -6\right)\right)}}\right)\right) \]
            2. clear-numN/A

              \[\leadsto \mathsf{+.f64}\left(x, \left(\left(y - x\right) \cdot \frac{1}{\color{blue}{\frac{4 \cdot 4 + \left(\left(z \cdot -6\right) \cdot \left(z \cdot -6\right) - 4 \cdot \left(z \cdot -6\right)\right)}{{4}^{3} + {\left(z \cdot -6\right)}^{3}}}}\right)\right) \]
            3. un-div-invN/A

              \[\leadsto \mathsf{+.f64}\left(x, \left(\frac{y - x}{\color{blue}{\frac{4 \cdot 4 + \left(\left(z \cdot -6\right) \cdot \left(z \cdot -6\right) - 4 \cdot \left(z \cdot -6\right)\right)}{{4}^{3} + {\left(z \cdot -6\right)}^{3}}}}\right)\right) \]
            4. /-lowering-/.f64N/A

              \[\leadsto \mathsf{+.f64}\left(x, \mathsf{/.f64}\left(\left(y - x\right), \color{blue}{\left(\frac{4 \cdot 4 + \left(\left(z \cdot -6\right) \cdot \left(z \cdot -6\right) - 4 \cdot \left(z \cdot -6\right)\right)}{{4}^{3} + {\left(z \cdot -6\right)}^{3}}\right)}\right)\right) \]
            5. --lowering--.f64N/A

              \[\leadsto \mathsf{+.f64}\left(x, \mathsf{/.f64}\left(\mathsf{\_.f64}\left(y, x\right), \left(\frac{\color{blue}{4 \cdot 4 + \left(\left(z \cdot -6\right) \cdot \left(z \cdot -6\right) - 4 \cdot \left(z \cdot -6\right)\right)}}{{4}^{3} + {\left(z \cdot -6\right)}^{3}}\right)\right)\right) \]
            6. clear-numN/A

              \[\leadsto \mathsf{+.f64}\left(x, \mathsf{/.f64}\left(\mathsf{\_.f64}\left(y, x\right), \left(\frac{1}{\color{blue}{\frac{{4}^{3} + {\left(z \cdot -6\right)}^{3}}{4 \cdot 4 + \left(\left(z \cdot -6\right) \cdot \left(z \cdot -6\right) - 4 \cdot \left(z \cdot -6\right)\right)}}}\right)\right)\right) \]
            7. flip3-+N/A

              \[\leadsto \mathsf{+.f64}\left(x, \mathsf{/.f64}\left(\mathsf{\_.f64}\left(y, x\right), \left(\frac{1}{4 + \color{blue}{z \cdot -6}}\right)\right)\right) \]
            8. /-lowering-/.f64N/A

              \[\leadsto \mathsf{+.f64}\left(x, \mathsf{/.f64}\left(\mathsf{\_.f64}\left(y, x\right), \mathsf{/.f64}\left(1, \color{blue}{\left(4 + z \cdot -6\right)}\right)\right)\right) \]
            9. +-lowering-+.f64N/A

              \[\leadsto \mathsf{+.f64}\left(x, \mathsf{/.f64}\left(\mathsf{\_.f64}\left(y, x\right), \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(4, \color{blue}{\left(z \cdot -6\right)}\right)\right)\right)\right) \]
            10. *-lowering-*.f6499.7%

              \[\leadsto \mathsf{+.f64}\left(x, \mathsf{/.f64}\left(\mathsf{\_.f64}\left(y, x\right), \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(4, \mathsf{*.f64}\left(z, \color{blue}{-6}\right)\right)\right)\right)\right) \]
          6. Applied egg-rr99.7%

            \[\leadsto x + \color{blue}{\frac{y - x}{\frac{1}{4 + z \cdot -6}}} \]
          7. Taylor expanded in z around inf

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

              \[\leadsto \mathsf{*.f64}\left(-6, \color{blue}{\left(z \cdot \left(y - x\right)\right)}\right) \]
            2. *-lowering-*.f64N/A

              \[\leadsto \mathsf{*.f64}\left(-6, \mathsf{*.f64}\left(z, \color{blue}{\left(y - x\right)}\right)\right) \]
            3. --lowering--.f6497.3%

              \[\leadsto \mathsf{*.f64}\left(-6, \mathsf{*.f64}\left(z, \mathsf{\_.f64}\left(y, \color{blue}{x}\right)\right)\right) \]
          9. Simplified97.3%

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

          if -5.1999999999999997e-16 < z < 5.3e-289 or 9.8000000000000001e-147 < z < 0.619999999999999996

          1. Initial program 99.5%

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

            \[\leadsto \color{blue}{6 \cdot \left(y \cdot \left(\frac{2}{3} - z\right)\right)} \]
          4. Step-by-step derivation
            1. *-lowering-*.f64N/A

              \[\leadsto \mathsf{*.f64}\left(6, \color{blue}{\left(y \cdot \left(\frac{2}{3} - z\right)\right)}\right) \]
            2. *-lowering-*.f64N/A

              \[\leadsto \mathsf{*.f64}\left(6, \mathsf{*.f64}\left(y, \color{blue}{\left(\frac{2}{3} - z\right)}\right)\right) \]
            3. --lowering--.f6462.9%

              \[\leadsto \mathsf{*.f64}\left(6, \mathsf{*.f64}\left(y, \mathsf{\_.f64}\left(\frac{2}{3}, \color{blue}{z}\right)\right)\right) \]
          5. Simplified62.9%

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

            \[\leadsto \color{blue}{4 \cdot y} \]
          7. Step-by-step derivation
            1. *-commutativeN/A

              \[\leadsto y \cdot \color{blue}{4} \]
            2. *-lowering-*.f6462.7%

              \[\leadsto \mathsf{*.f64}\left(y, \color{blue}{4}\right) \]
          8. Simplified62.7%

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

          if 5.3e-289 < z < 9.8000000000000001e-147

          1. Initial program 99.4%

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

              \[\leadsto \mathsf{+.f64}\left(x, \color{blue}{\left(\left(\left(y - x\right) \cdot 6\right) \cdot \left(\frac{2}{3} - z\right)\right)}\right) \]
            2. associate-*l*N/A

              \[\leadsto \mathsf{+.f64}\left(x, \left(\left(y - x\right) \cdot \color{blue}{\left(6 \cdot \left(\frac{2}{3} - z\right)\right)}\right)\right) \]
            3. *-lowering-*.f64N/A

              \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(\left(y - x\right), \color{blue}{\left(6 \cdot \left(\frac{2}{3} - z\right)\right)}\right)\right) \]
            4. --lowering--.f64N/A

              \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(y, x\right), \left(\color{blue}{6} \cdot \left(\frac{2}{3} - z\right)\right)\right)\right) \]
            5. sub-negN/A

              \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(y, x\right), \left(6 \cdot \left(\frac{2}{3} + \color{blue}{\left(\mathsf{neg}\left(z\right)\right)}\right)\right)\right)\right) \]
            6. distribute-lft-inN/A

              \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(y, x\right), \left(6 \cdot \frac{2}{3} + \color{blue}{6 \cdot \left(\mathsf{neg}\left(z\right)\right)}\right)\right)\right) \]
            7. *-commutativeN/A

              \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(y, x\right), \left(6 \cdot \frac{2}{3} + \left(\mathsf{neg}\left(z\right)\right) \cdot \color{blue}{6}\right)\right)\right) \]
            8. +-lowering-+.f64N/A

              \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(y, x\right), \mathsf{+.f64}\left(\left(6 \cdot \frac{2}{3}\right), \color{blue}{\left(\left(\mathsf{neg}\left(z\right)\right) \cdot 6\right)}\right)\right)\right) \]
            9. metadata-evalN/A

              \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(y, x\right), \mathsf{+.f64}\left(\left(6 \cdot \frac{2}{3}\right), \left(\left(\mathsf{neg}\left(z\right)\right) \cdot 6\right)\right)\right)\right) \]
            10. metadata-evalN/A

              \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(y, x\right), \mathsf{+.f64}\left(4, \left(\color{blue}{\left(\mathsf{neg}\left(z\right)\right)} \cdot 6\right)\right)\right)\right) \]
            11. distribute-lft-neg-outN/A

              \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(y, x\right), \mathsf{+.f64}\left(4, \left(\mathsf{neg}\left(z \cdot 6\right)\right)\right)\right)\right) \]
            12. distribute-rgt-neg-inN/A

              \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(y, x\right), \mathsf{+.f64}\left(4, \left(z \cdot \color{blue}{\left(\mathsf{neg}\left(6\right)\right)}\right)\right)\right)\right) \]
            13. metadata-evalN/A

              \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(y, x\right), \mathsf{+.f64}\left(4, \left(z \cdot -6\right)\right)\right)\right) \]
            14. metadata-evalN/A

              \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(y, x\right), \mathsf{+.f64}\left(4, \left(z \cdot \left(6 \cdot \color{blue}{-1}\right)\right)\right)\right)\right) \]
            15. *-lowering-*.f64N/A

              \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(y, x\right), \mathsf{+.f64}\left(4, \mathsf{*.f64}\left(z, \color{blue}{\left(6 \cdot -1\right)}\right)\right)\right)\right) \]
            16. metadata-eval99.6%

              \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(y, x\right), \mathsf{+.f64}\left(4, \mathsf{*.f64}\left(z, -6\right)\right)\right)\right) \]
          3. Simplified99.6%

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

            \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(y, x\right), \color{blue}{4}\right)\right) \]
          6. Step-by-step derivation
            1. Simplified99.6%

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

              \[\leadsto \color{blue}{-3 \cdot x} \]
            3. Step-by-step derivation
              1. *-commutativeN/A

                \[\leadsto x \cdot \color{blue}{-3} \]
              2. *-lowering-*.f6463.0%

                \[\leadsto \mathsf{*.f64}\left(x, \color{blue}{-3}\right) \]
            4. Simplified63.0%

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

            \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -5.2 \cdot 10^{-16}:\\ \;\;\;\;-6 \cdot \left(\left(y - x\right) \cdot z\right)\\ \mathbf{elif}\;z \leq 5.3 \cdot 10^{-289}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 9.8 \cdot 10^{-147}:\\ \;\;\;\;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} \]
          9. Add Preprocessing

          Alternative 6: 50.1% accurate, 0.5× speedup?

          \[\begin{array}{l} \\ \begin{array}{l} t_0 := -6 \cdot \left(y \cdot z\right)\\ \mathbf{if}\;z \leq -5.2 \cdot 10^{-16}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;z \leq 7.5 \cdot 10^{-284}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;z \leq 1.25 \cdot 10^{-148}:\\ \;\;\;\;x \cdot -3\\ \mathbf{elif}\;z \leq 0.68:\\ \;\;\;\;y \cdot 4\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
          (FPCore (x y z)
           :precision binary64
           (let* ((t_0 (* -6.0 (* y z))))
             (if (<= z -5.2e-16)
               t_0
               (if (<= z 7.5e-284)
                 (* y 4.0)
                 (if (<= z 1.25e-148) (* x -3.0) (if (<= z 0.68) (* y 4.0) t_0))))))
          double code(double x, double y, double z) {
          	double t_0 = -6.0 * (y * z);
          	double tmp;
          	if (z <= -5.2e-16) {
          		tmp = t_0;
          	} else if (z <= 7.5e-284) {
          		tmp = y * 4.0;
          	} else if (z <= 1.25e-148) {
          		tmp = x * -3.0;
          	} else if (z <= 0.68) {
          		tmp = y * 4.0;
          	} else {
          		tmp = t_0;
          	}
          	return tmp;
          }
          
          real(8) function code(x, y, z)
              real(8), intent (in) :: x
              real(8), intent (in) :: y
              real(8), intent (in) :: z
              real(8) :: t_0
              real(8) :: tmp
              t_0 = (-6.0d0) * (y * z)
              if (z <= (-5.2d-16)) then
                  tmp = t_0
              else if (z <= 7.5d-284) then
                  tmp = y * 4.0d0
              else if (z <= 1.25d-148) then
                  tmp = x * (-3.0d0)
              else if (z <= 0.68d0) then
                  tmp = y * 4.0d0
              else
                  tmp = t_0
              end if
              code = tmp
          end function
          
          public static double code(double x, double y, double z) {
          	double t_0 = -6.0 * (y * z);
          	double tmp;
          	if (z <= -5.2e-16) {
          		tmp = t_0;
          	} else if (z <= 7.5e-284) {
          		tmp = y * 4.0;
          	} else if (z <= 1.25e-148) {
          		tmp = x * -3.0;
          	} else if (z <= 0.68) {
          		tmp = y * 4.0;
          	} else {
          		tmp = t_0;
          	}
          	return tmp;
          }
          
          def code(x, y, z):
          	t_0 = -6.0 * (y * z)
          	tmp = 0
          	if z <= -5.2e-16:
          		tmp = t_0
          	elif z <= 7.5e-284:
          		tmp = y * 4.0
          	elif z <= 1.25e-148:
          		tmp = x * -3.0
          	elif z <= 0.68:
          		tmp = y * 4.0
          	else:
          		tmp = t_0
          	return tmp
          
          function code(x, y, z)
          	t_0 = Float64(-6.0 * Float64(y * z))
          	tmp = 0.0
          	if (z <= -5.2e-16)
          		tmp = t_0;
          	elseif (z <= 7.5e-284)
          		tmp = Float64(y * 4.0);
          	elseif (z <= 1.25e-148)
          		tmp = Float64(x * -3.0);
          	elseif (z <= 0.68)
          		tmp = Float64(y * 4.0);
          	else
          		tmp = t_0;
          	end
          	return tmp
          end
          
          function tmp_2 = code(x, y, z)
          	t_0 = -6.0 * (y * z);
          	tmp = 0.0;
          	if (z <= -5.2e-16)
          		tmp = t_0;
          	elseif (z <= 7.5e-284)
          		tmp = y * 4.0;
          	elseif (z <= 1.25e-148)
          		tmp = x * -3.0;
          	elseif (z <= 0.68)
          		tmp = y * 4.0;
          	else
          		tmp = t_0;
          	end
          	tmp_2 = tmp;
          end
          
          code[x_, y_, z_] := Block[{t$95$0 = N[(-6.0 * N[(y * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -5.2e-16], t$95$0, If[LessEqual[z, 7.5e-284], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 1.25e-148], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 0.68], N[(y * 4.0), $MachinePrecision], t$95$0]]]]]
          
          \begin{array}{l}
          
          \\
          \begin{array}{l}
          t_0 := -6 \cdot \left(y \cdot z\right)\\
          \mathbf{if}\;z \leq -5.2 \cdot 10^{-16}:\\
          \;\;\;\;t\_0\\
          
          \mathbf{elif}\;z \leq 7.5 \cdot 10^{-284}:\\
          \;\;\;\;y \cdot 4\\
          
          \mathbf{elif}\;z \leq 1.25 \cdot 10^{-148}:\\
          \;\;\;\;x \cdot -3\\
          
          \mathbf{elif}\;z \leq 0.68:\\
          \;\;\;\;y \cdot 4\\
          
          \mathbf{else}:\\
          \;\;\;\;t\_0\\
          
          
          \end{array}
          \end{array}
          
          Derivation
          1. Split input into 3 regimes
          2. if z < -5.1999999999999997e-16 or 0.680000000000000049 < z

            1. Initial program 99.7%

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

              \[\leadsto \color{blue}{6 \cdot \left(y \cdot \left(\frac{2}{3} - z\right)\right)} \]
            4. Step-by-step derivation
              1. *-lowering-*.f64N/A

                \[\leadsto \mathsf{*.f64}\left(6, \color{blue}{\left(y \cdot \left(\frac{2}{3} - z\right)\right)}\right) \]
              2. *-lowering-*.f64N/A

                \[\leadsto \mathsf{*.f64}\left(6, \mathsf{*.f64}\left(y, \color{blue}{\left(\frac{2}{3} - z\right)}\right)\right) \]
              3. --lowering--.f6452.6%

                \[\leadsto \mathsf{*.f64}\left(6, \mathsf{*.f64}\left(y, \mathsf{\_.f64}\left(\frac{2}{3}, \color{blue}{z}\right)\right)\right) \]
            5. Simplified52.6%

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

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

                \[\leadsto \mathsf{*.f64}\left(-6, \color{blue}{\left(y \cdot z\right)}\right) \]
              2. *-lowering-*.f6452.2%

                \[\leadsto \mathsf{*.f64}\left(-6, \mathsf{*.f64}\left(y, \color{blue}{z}\right)\right) \]
            8. Simplified52.2%

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

            if -5.1999999999999997e-16 < z < 7.4999999999999999e-284 or 1.25e-148 < z < 0.680000000000000049

            1. Initial program 99.5%

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

              \[\leadsto \color{blue}{6 \cdot \left(y \cdot \left(\frac{2}{3} - z\right)\right)} \]
            4. Step-by-step derivation
              1. *-lowering-*.f64N/A

                \[\leadsto \mathsf{*.f64}\left(6, \color{blue}{\left(y \cdot \left(\frac{2}{3} - z\right)\right)}\right) \]
              2. *-lowering-*.f64N/A

                \[\leadsto \mathsf{*.f64}\left(6, \mathsf{*.f64}\left(y, \color{blue}{\left(\frac{2}{3} - z\right)}\right)\right) \]
              3. --lowering--.f6462.9%

                \[\leadsto \mathsf{*.f64}\left(6, \mathsf{*.f64}\left(y, \mathsf{\_.f64}\left(\frac{2}{3}, \color{blue}{z}\right)\right)\right) \]
            5. Simplified62.9%

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

              \[\leadsto \color{blue}{4 \cdot y} \]
            7. Step-by-step derivation
              1. *-commutativeN/A

                \[\leadsto y \cdot \color{blue}{4} \]
              2. *-lowering-*.f6462.7%

                \[\leadsto \mathsf{*.f64}\left(y, \color{blue}{4}\right) \]
            8. Simplified62.7%

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

            if 7.4999999999999999e-284 < z < 1.25e-148

            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. +-lowering-+.f64N/A

                \[\leadsto \mathsf{+.f64}\left(x, \color{blue}{\left(\left(\left(y - x\right) \cdot 6\right) \cdot \left(\frac{2}{3} - z\right)\right)}\right) \]
              2. associate-*l*N/A

                \[\leadsto \mathsf{+.f64}\left(x, \left(\left(y - x\right) \cdot \color{blue}{\left(6 \cdot \left(\frac{2}{3} - z\right)\right)}\right)\right) \]
              3. *-lowering-*.f64N/A

                \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(\left(y - x\right), \color{blue}{\left(6 \cdot \left(\frac{2}{3} - z\right)\right)}\right)\right) \]
              4. --lowering--.f64N/A

                \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(y, x\right), \left(\color{blue}{6} \cdot \left(\frac{2}{3} - z\right)\right)\right)\right) \]
              5. sub-negN/A

                \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(y, x\right), \left(6 \cdot \left(\frac{2}{3} + \color{blue}{\left(\mathsf{neg}\left(z\right)\right)}\right)\right)\right)\right) \]
              6. distribute-lft-inN/A

                \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(y, x\right), \left(6 \cdot \frac{2}{3} + \color{blue}{6 \cdot \left(\mathsf{neg}\left(z\right)\right)}\right)\right)\right) \]
              7. *-commutativeN/A

                \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(y, x\right), \left(6 \cdot \frac{2}{3} + \left(\mathsf{neg}\left(z\right)\right) \cdot \color{blue}{6}\right)\right)\right) \]
              8. +-lowering-+.f64N/A

                \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(y, x\right), \mathsf{+.f64}\left(\left(6 \cdot \frac{2}{3}\right), \color{blue}{\left(\left(\mathsf{neg}\left(z\right)\right) \cdot 6\right)}\right)\right)\right) \]
              9. metadata-evalN/A

                \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(y, x\right), \mathsf{+.f64}\left(\left(6 \cdot \frac{2}{3}\right), \left(\left(\mathsf{neg}\left(z\right)\right) \cdot 6\right)\right)\right)\right) \]
              10. metadata-evalN/A

                \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(y, x\right), \mathsf{+.f64}\left(4, \left(\color{blue}{\left(\mathsf{neg}\left(z\right)\right)} \cdot 6\right)\right)\right)\right) \]
              11. distribute-lft-neg-outN/A

                \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(y, x\right), \mathsf{+.f64}\left(4, \left(\mathsf{neg}\left(z \cdot 6\right)\right)\right)\right)\right) \]
              12. distribute-rgt-neg-inN/A

                \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(y, x\right), \mathsf{+.f64}\left(4, \left(z \cdot \color{blue}{\left(\mathsf{neg}\left(6\right)\right)}\right)\right)\right)\right) \]
              13. metadata-evalN/A

                \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(y, x\right), \mathsf{+.f64}\left(4, \left(z \cdot -6\right)\right)\right)\right) \]
              14. metadata-evalN/A

                \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(y, x\right), \mathsf{+.f64}\left(4, \left(z \cdot \left(6 \cdot \color{blue}{-1}\right)\right)\right)\right)\right) \]
              15. *-lowering-*.f64N/A

                \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(y, x\right), \mathsf{+.f64}\left(4, \mathsf{*.f64}\left(z, \color{blue}{\left(6 \cdot -1\right)}\right)\right)\right)\right) \]
              16. metadata-eval99.6%

                \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(y, x\right), \mathsf{+.f64}\left(4, \mathsf{*.f64}\left(z, -6\right)\right)\right)\right) \]
            3. Simplified99.6%

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

              \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(y, x\right), \color{blue}{4}\right)\right) \]
            6. Step-by-step derivation
              1. Simplified99.6%

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

                \[\leadsto \color{blue}{-3 \cdot x} \]
              3. Step-by-step derivation
                1. *-commutativeN/A

                  \[\leadsto x \cdot \color{blue}{-3} \]
                2. *-lowering-*.f6463.0%

                  \[\leadsto \mathsf{*.f64}\left(x, \color{blue}{-3}\right) \]
              4. Simplified63.0%

                \[\leadsto \color{blue}{x \cdot -3} \]
            7. Recombined 3 regimes into one program.
            8. Add Preprocessing

            Alternative 7: 97.6% accurate, 0.7× speedup?

            \[\begin{array}{l} \\ \begin{array}{l} t_0 := x + \left(y - x\right) \cdot \left(z \cdot -6\right)\\ \mathbf{if}\;z \leq -0.66:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;z \leq 0.65:\\ \;\;\;\;x + \left(y - x\right) \cdot 4\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
            (FPCore (x y z)
             :precision binary64
             (let* ((t_0 (+ x (* (- y x) (* z -6.0)))))
               (if (<= z -0.66) t_0 (if (<= z 0.65) (+ x (* (- y x) 4.0)) t_0))))
            double code(double x, double y, double z) {
            	double t_0 = x + ((y - x) * (z * -6.0));
            	double tmp;
            	if (z <= -0.66) {
            		tmp = t_0;
            	} else if (z <= 0.65) {
            		tmp = x + ((y - x) * 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 = x + ((y - x) * (z * (-6.0d0)))
                if (z <= (-0.66d0)) then
                    tmp = t_0
                else if (z <= 0.65d0) then
                    tmp = x + ((y - x) * 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 = x + ((y - x) * (z * -6.0));
            	double tmp;
            	if (z <= -0.66) {
            		tmp = t_0;
            	} else if (z <= 0.65) {
            		tmp = x + ((y - x) * 4.0);
            	} else {
            		tmp = t_0;
            	}
            	return tmp;
            }
            
            def code(x, y, z):
            	t_0 = x + ((y - x) * (z * -6.0))
            	tmp = 0
            	if z <= -0.66:
            		tmp = t_0
            	elif z <= 0.65:
            		tmp = x + ((y - x) * 4.0)
            	else:
            		tmp = t_0
            	return tmp
            
            function code(x, y, z)
            	t_0 = Float64(x + Float64(Float64(y - x) * Float64(z * -6.0)))
            	tmp = 0.0
            	if (z <= -0.66)
            		tmp = t_0;
            	elseif (z <= 0.65)
            		tmp = Float64(x + Float64(Float64(y - x) * 4.0));
            	else
            		tmp = t_0;
            	end
            	return tmp
            end
            
            function tmp_2 = code(x, y, z)
            	t_0 = x + ((y - x) * (z * -6.0));
            	tmp = 0.0;
            	if (z <= -0.66)
            		tmp = t_0;
            	elseif (z <= 0.65)
            		tmp = x + ((y - x) * 4.0);
            	else
            		tmp = t_0;
            	end
            	tmp_2 = tmp;
            end
            
            code[x_, y_, z_] := Block[{t$95$0 = N[(x + N[(N[(y - x), $MachinePrecision] * N[(z * -6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -0.66], t$95$0, If[LessEqual[z, 0.65], N[(x + N[(N[(y - x), $MachinePrecision] * 4.0), $MachinePrecision]), $MachinePrecision], t$95$0]]]
            
            \begin{array}{l}
            
            \\
            \begin{array}{l}
            t_0 := x + \left(y - x\right) \cdot \left(z \cdot -6\right)\\
            \mathbf{if}\;z \leq -0.66:\\
            \;\;\;\;t\_0\\
            
            \mathbf{elif}\;z \leq 0.65:\\
            \;\;\;\;x + \left(y - x\right) \cdot 4\\
            
            \mathbf{else}:\\
            \;\;\;\;t\_0\\
            
            
            \end{array}
            \end{array}
            
            Derivation
            1. Split input into 2 regimes
            2. if z < -0.660000000000000031 or 0.650000000000000022 < 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. +-lowering-+.f64N/A

                  \[\leadsto \mathsf{+.f64}\left(x, \color{blue}{\left(\left(\left(y - x\right) \cdot 6\right) \cdot \left(\frac{2}{3} - z\right)\right)}\right) \]
                2. associate-*l*N/A

                  \[\leadsto \mathsf{+.f64}\left(x, \left(\left(y - x\right) \cdot \color{blue}{\left(6 \cdot \left(\frac{2}{3} - z\right)\right)}\right)\right) \]
                3. *-lowering-*.f64N/A

                  \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(\left(y - x\right), \color{blue}{\left(6 \cdot \left(\frac{2}{3} - z\right)\right)}\right)\right) \]
                4. --lowering--.f64N/A

                  \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(y, x\right), \left(\color{blue}{6} \cdot \left(\frac{2}{3} - z\right)\right)\right)\right) \]
                5. sub-negN/A

                  \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(y, x\right), \left(6 \cdot \left(\frac{2}{3} + \color{blue}{\left(\mathsf{neg}\left(z\right)\right)}\right)\right)\right)\right) \]
                6. distribute-lft-inN/A

                  \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(y, x\right), \left(6 \cdot \frac{2}{3} + \color{blue}{6 \cdot \left(\mathsf{neg}\left(z\right)\right)}\right)\right)\right) \]
                7. *-commutativeN/A

                  \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(y, x\right), \left(6 \cdot \frac{2}{3} + \left(\mathsf{neg}\left(z\right)\right) \cdot \color{blue}{6}\right)\right)\right) \]
                8. +-lowering-+.f64N/A

                  \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(y, x\right), \mathsf{+.f64}\left(\left(6 \cdot \frac{2}{3}\right), \color{blue}{\left(\left(\mathsf{neg}\left(z\right)\right) \cdot 6\right)}\right)\right)\right) \]
                9. metadata-evalN/A

                  \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(y, x\right), \mathsf{+.f64}\left(\left(6 \cdot \frac{2}{3}\right), \left(\left(\mathsf{neg}\left(z\right)\right) \cdot 6\right)\right)\right)\right) \]
                10. metadata-evalN/A

                  \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(y, x\right), \mathsf{+.f64}\left(4, \left(\color{blue}{\left(\mathsf{neg}\left(z\right)\right)} \cdot 6\right)\right)\right)\right) \]
                11. distribute-lft-neg-outN/A

                  \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(y, x\right), \mathsf{+.f64}\left(4, \left(\mathsf{neg}\left(z \cdot 6\right)\right)\right)\right)\right) \]
                12. distribute-rgt-neg-inN/A

                  \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(y, x\right), \mathsf{+.f64}\left(4, \left(z \cdot \color{blue}{\left(\mathsf{neg}\left(6\right)\right)}\right)\right)\right)\right) \]
                13. metadata-evalN/A

                  \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(y, x\right), \mathsf{+.f64}\left(4, \left(z \cdot -6\right)\right)\right)\right) \]
                14. metadata-evalN/A

                  \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(y, x\right), \mathsf{+.f64}\left(4, \left(z \cdot \left(6 \cdot \color{blue}{-1}\right)\right)\right)\right)\right) \]
                15. *-lowering-*.f64N/A

                  \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(y, x\right), \mathsf{+.f64}\left(4, \mathsf{*.f64}\left(z, \color{blue}{\left(6 \cdot -1\right)}\right)\right)\right)\right) \]
                16. metadata-eval99.8%

                  \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(y, x\right), \mathsf{+.f64}\left(4, \mathsf{*.f64}\left(z, -6\right)\right)\right)\right) \]
              3. Simplified99.8%

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

                \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(y, x\right), \color{blue}{\left(-6 \cdot z\right)}\right)\right) \]
              6. Step-by-step derivation
                1. *-commutativeN/A

                  \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(y, x\right), \left(z \cdot \color{blue}{-6}\right)\right)\right) \]
                2. *-lowering-*.f6498.6%

                  \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(y, x\right), \mathsf{*.f64}\left(z, \color{blue}{-6}\right)\right)\right) \]
              7. Simplified98.6%

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

              if -0.660000000000000031 < z < 0.650000000000000022

              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. +-lowering-+.f64N/A

                  \[\leadsto \mathsf{+.f64}\left(x, \color{blue}{\left(\left(\left(y - x\right) \cdot 6\right) \cdot \left(\frac{2}{3} - z\right)\right)}\right) \]
                2. associate-*l*N/A

                  \[\leadsto \mathsf{+.f64}\left(x, \left(\left(y - x\right) \cdot \color{blue}{\left(6 \cdot \left(\frac{2}{3} - z\right)\right)}\right)\right) \]
                3. *-lowering-*.f64N/A

                  \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(\left(y - x\right), \color{blue}{\left(6 \cdot \left(\frac{2}{3} - z\right)\right)}\right)\right) \]
                4. --lowering--.f64N/A

                  \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(y, x\right), \left(\color{blue}{6} \cdot \left(\frac{2}{3} - z\right)\right)\right)\right) \]
                5. sub-negN/A

                  \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(y, x\right), \left(6 \cdot \left(\frac{2}{3} + \color{blue}{\left(\mathsf{neg}\left(z\right)\right)}\right)\right)\right)\right) \]
                6. distribute-lft-inN/A

                  \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(y, x\right), \left(6 \cdot \frac{2}{3} + \color{blue}{6 \cdot \left(\mathsf{neg}\left(z\right)\right)}\right)\right)\right) \]
                7. *-commutativeN/A

                  \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(y, x\right), \left(6 \cdot \frac{2}{3} + \left(\mathsf{neg}\left(z\right)\right) \cdot \color{blue}{6}\right)\right)\right) \]
                8. +-lowering-+.f64N/A

                  \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(y, x\right), \mathsf{+.f64}\left(\left(6 \cdot \frac{2}{3}\right), \color{blue}{\left(\left(\mathsf{neg}\left(z\right)\right) \cdot 6\right)}\right)\right)\right) \]
                9. metadata-evalN/A

                  \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(y, x\right), \mathsf{+.f64}\left(\left(6 \cdot \frac{2}{3}\right), \left(\left(\mathsf{neg}\left(z\right)\right) \cdot 6\right)\right)\right)\right) \]
                10. metadata-evalN/A

                  \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(y, x\right), \mathsf{+.f64}\left(4, \left(\color{blue}{\left(\mathsf{neg}\left(z\right)\right)} \cdot 6\right)\right)\right)\right) \]
                11. distribute-lft-neg-outN/A

                  \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(y, x\right), \mathsf{+.f64}\left(4, \left(\mathsf{neg}\left(z \cdot 6\right)\right)\right)\right)\right) \]
                12. distribute-rgt-neg-inN/A

                  \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(y, x\right), \mathsf{+.f64}\left(4, \left(z \cdot \color{blue}{\left(\mathsf{neg}\left(6\right)\right)}\right)\right)\right)\right) \]
                13. metadata-evalN/A

                  \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(y, x\right), \mathsf{+.f64}\left(4, \left(z \cdot -6\right)\right)\right)\right) \]
                14. metadata-evalN/A

                  \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(y, x\right), \mathsf{+.f64}\left(4, \left(z \cdot \left(6 \cdot \color{blue}{-1}\right)\right)\right)\right)\right) \]
                15. *-lowering-*.f64N/A

                  \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(y, x\right), \mathsf{+.f64}\left(4, \mathsf{*.f64}\left(z, \color{blue}{\left(6 \cdot -1\right)}\right)\right)\right)\right) \]
                16. metadata-eval99.8%

                  \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(y, x\right), \mathsf{+.f64}\left(4, \mathsf{*.f64}\left(z, -6\right)\right)\right)\right) \]
              3. Simplified99.8%

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

                \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(y, x\right), \color{blue}{4}\right)\right) \]
              6. Step-by-step derivation
                1. Simplified99.1%

                  \[\leadsto x + \left(y - x\right) \cdot \color{blue}{4} \]
              7. Recombined 2 regimes into one program.
              8. Add Preprocessing

              Alternative 8: 97.7% 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.58:\\ \;\;\;\;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.58) (+ 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.58) {
              		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.58d0) 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.58) {
              		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.58:
              		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.58)
              		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.58)
              		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.58], 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.58:\\
              \;\;\;\;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.6%

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

                    \[\leadsto \mathsf{+.f64}\left(x, \color{blue}{\left(\left(\left(y - x\right) \cdot 6\right) \cdot \left(\frac{2}{3} - z\right)\right)}\right) \]
                  2. associate-*l*N/A

                    \[\leadsto \mathsf{+.f64}\left(x, \left(\left(y - x\right) \cdot \color{blue}{\left(6 \cdot \left(\frac{2}{3} - z\right)\right)}\right)\right) \]
                  3. *-lowering-*.f64N/A

                    \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(\left(y - x\right), \color{blue}{\left(6 \cdot \left(\frac{2}{3} - z\right)\right)}\right)\right) \]
                  4. --lowering--.f64N/A

                    \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(y, x\right), \left(\color{blue}{6} \cdot \left(\frac{2}{3} - z\right)\right)\right)\right) \]
                  5. sub-negN/A

                    \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(y, x\right), \left(6 \cdot \left(\frac{2}{3} + \color{blue}{\left(\mathsf{neg}\left(z\right)\right)}\right)\right)\right)\right) \]
                  6. distribute-lft-inN/A

                    \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(y, x\right), \left(6 \cdot \frac{2}{3} + \color{blue}{6 \cdot \left(\mathsf{neg}\left(z\right)\right)}\right)\right)\right) \]
                  7. *-commutativeN/A

                    \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(y, x\right), \left(6 \cdot \frac{2}{3} + \left(\mathsf{neg}\left(z\right)\right) \cdot \color{blue}{6}\right)\right)\right) \]
                  8. +-lowering-+.f64N/A

                    \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(y, x\right), \mathsf{+.f64}\left(\left(6 \cdot \frac{2}{3}\right), \color{blue}{\left(\left(\mathsf{neg}\left(z\right)\right) \cdot 6\right)}\right)\right)\right) \]
                  9. metadata-evalN/A

                    \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(y, x\right), \mathsf{+.f64}\left(\left(6 \cdot \frac{2}{3}\right), \left(\left(\mathsf{neg}\left(z\right)\right) \cdot 6\right)\right)\right)\right) \]
                  10. metadata-evalN/A

                    \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(y, x\right), \mathsf{+.f64}\left(4, \left(\color{blue}{\left(\mathsf{neg}\left(z\right)\right)} \cdot 6\right)\right)\right)\right) \]
                  11. distribute-lft-neg-outN/A

                    \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(y, x\right), \mathsf{+.f64}\left(4, \left(\mathsf{neg}\left(z \cdot 6\right)\right)\right)\right)\right) \]
                  12. distribute-rgt-neg-inN/A

                    \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(y, x\right), \mathsf{+.f64}\left(4, \left(z \cdot \color{blue}{\left(\mathsf{neg}\left(6\right)\right)}\right)\right)\right)\right) \]
                  13. metadata-evalN/A

                    \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(y, x\right), \mathsf{+.f64}\left(4, \left(z \cdot -6\right)\right)\right)\right) \]
                  14. metadata-evalN/A

                    \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(y, x\right), \mathsf{+.f64}\left(4, \left(z \cdot \left(6 \cdot \color{blue}{-1}\right)\right)\right)\right)\right) \]
                  15. *-lowering-*.f64N/A

                    \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(y, x\right), \mathsf{+.f64}\left(4, \mathsf{*.f64}\left(z, \color{blue}{\left(6 \cdot -1\right)}\right)\right)\right)\right) \]
                  16. metadata-eval99.8%

                    \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(y, x\right), \mathsf{+.f64}\left(4, \mathsf{*.f64}\left(z, -6\right)\right)\right)\right) \]
                3. Simplified99.8%

                  \[\leadsto \color{blue}{x + \left(y - x\right) \cdot \left(4 + z \cdot -6\right)} \]
                4. Add Preprocessing
                5. Step-by-step derivation
                  1. flip3-+N/A

                    \[\leadsto \mathsf{+.f64}\left(x, \left(\left(y - x\right) \cdot \frac{{4}^{3} + {\left(z \cdot -6\right)}^{3}}{\color{blue}{4 \cdot 4 + \left(\left(z \cdot -6\right) \cdot \left(z \cdot -6\right) - 4 \cdot \left(z \cdot -6\right)\right)}}\right)\right) \]
                  2. clear-numN/A

                    \[\leadsto \mathsf{+.f64}\left(x, \left(\left(y - x\right) \cdot \frac{1}{\color{blue}{\frac{4 \cdot 4 + \left(\left(z \cdot -6\right) \cdot \left(z \cdot -6\right) - 4 \cdot \left(z \cdot -6\right)\right)}{{4}^{3} + {\left(z \cdot -6\right)}^{3}}}}\right)\right) \]
                  3. un-div-invN/A

                    \[\leadsto \mathsf{+.f64}\left(x, \left(\frac{y - x}{\color{blue}{\frac{4 \cdot 4 + \left(\left(z \cdot -6\right) \cdot \left(z \cdot -6\right) - 4 \cdot \left(z \cdot -6\right)\right)}{{4}^{3} + {\left(z \cdot -6\right)}^{3}}}}\right)\right) \]
                  4. /-lowering-/.f64N/A

                    \[\leadsto \mathsf{+.f64}\left(x, \mathsf{/.f64}\left(\left(y - x\right), \color{blue}{\left(\frac{4 \cdot 4 + \left(\left(z \cdot -6\right) \cdot \left(z \cdot -6\right) - 4 \cdot \left(z \cdot -6\right)\right)}{{4}^{3} + {\left(z \cdot -6\right)}^{3}}\right)}\right)\right) \]
                  5. --lowering--.f64N/A

                    \[\leadsto \mathsf{+.f64}\left(x, \mathsf{/.f64}\left(\mathsf{\_.f64}\left(y, x\right), \left(\frac{\color{blue}{4 \cdot 4 + \left(\left(z \cdot -6\right) \cdot \left(z \cdot -6\right) - 4 \cdot \left(z \cdot -6\right)\right)}}{{4}^{3} + {\left(z \cdot -6\right)}^{3}}\right)\right)\right) \]
                  6. clear-numN/A

                    \[\leadsto \mathsf{+.f64}\left(x, \mathsf{/.f64}\left(\mathsf{\_.f64}\left(y, x\right), \left(\frac{1}{\color{blue}{\frac{{4}^{3} + {\left(z \cdot -6\right)}^{3}}{4 \cdot 4 + \left(\left(z \cdot -6\right) \cdot \left(z \cdot -6\right) - 4 \cdot \left(z \cdot -6\right)\right)}}}\right)\right)\right) \]
                  7. flip3-+N/A

                    \[\leadsto \mathsf{+.f64}\left(x, \mathsf{/.f64}\left(\mathsf{\_.f64}\left(y, x\right), \left(\frac{1}{4 + \color{blue}{z \cdot -6}}\right)\right)\right) \]
                  8. /-lowering-/.f64N/A

                    \[\leadsto \mathsf{+.f64}\left(x, \mathsf{/.f64}\left(\mathsf{\_.f64}\left(y, x\right), \mathsf{/.f64}\left(1, \color{blue}{\left(4 + z \cdot -6\right)}\right)\right)\right) \]
                  9. +-lowering-+.f64N/A

                    \[\leadsto \mathsf{+.f64}\left(x, \mathsf{/.f64}\left(\mathsf{\_.f64}\left(y, x\right), \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(4, \color{blue}{\left(z \cdot -6\right)}\right)\right)\right)\right) \]
                  10. *-lowering-*.f6499.7%

                    \[\leadsto \mathsf{+.f64}\left(x, \mathsf{/.f64}\left(\mathsf{\_.f64}\left(y, x\right), \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(4, \mathsf{*.f64}\left(z, \color{blue}{-6}\right)\right)\right)\right)\right) \]
                6. Applied egg-rr99.7%

                  \[\leadsto x + \color{blue}{\frac{y - x}{\frac{1}{4 + z \cdot -6}}} \]
                7. Taylor expanded in z around inf

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

                    \[\leadsto \mathsf{*.f64}\left(-6, \color{blue}{\left(z \cdot \left(y - x\right)\right)}\right) \]
                  2. *-lowering-*.f64N/A

                    \[\leadsto \mathsf{*.f64}\left(-6, \mathsf{*.f64}\left(z, \color{blue}{\left(y - x\right)}\right)\right) \]
                  3. --lowering--.f6498.3%

                    \[\leadsto \mathsf{*.f64}\left(-6, \mathsf{*.f64}\left(z, \mathsf{\_.f64}\left(y, \color{blue}{x}\right)\right)\right) \]
                9. Simplified98.3%

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

                if -0.55000000000000004 < z < 0.57999999999999996

                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. +-lowering-+.f64N/A

                    \[\leadsto \mathsf{+.f64}\left(x, \color{blue}{\left(\left(\left(y - x\right) \cdot 6\right) \cdot \left(\frac{2}{3} - z\right)\right)}\right) \]
                  2. associate-*l*N/A

                    \[\leadsto \mathsf{+.f64}\left(x, \left(\left(y - x\right) \cdot \color{blue}{\left(6 \cdot \left(\frac{2}{3} - z\right)\right)}\right)\right) \]
                  3. *-lowering-*.f64N/A

                    \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(\left(y - x\right), \color{blue}{\left(6 \cdot \left(\frac{2}{3} - z\right)\right)}\right)\right) \]
                  4. --lowering--.f64N/A

                    \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(y, x\right), \left(\color{blue}{6} \cdot \left(\frac{2}{3} - z\right)\right)\right)\right) \]
                  5. sub-negN/A

                    \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(y, x\right), \left(6 \cdot \left(\frac{2}{3} + \color{blue}{\left(\mathsf{neg}\left(z\right)\right)}\right)\right)\right)\right) \]
                  6. distribute-lft-inN/A

                    \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(y, x\right), \left(6 \cdot \frac{2}{3} + \color{blue}{6 \cdot \left(\mathsf{neg}\left(z\right)\right)}\right)\right)\right) \]
                  7. *-commutativeN/A

                    \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(y, x\right), \left(6 \cdot \frac{2}{3} + \left(\mathsf{neg}\left(z\right)\right) \cdot \color{blue}{6}\right)\right)\right) \]
                  8. +-lowering-+.f64N/A

                    \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(y, x\right), \mathsf{+.f64}\left(\left(6 \cdot \frac{2}{3}\right), \color{blue}{\left(\left(\mathsf{neg}\left(z\right)\right) \cdot 6\right)}\right)\right)\right) \]
                  9. metadata-evalN/A

                    \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(y, x\right), \mathsf{+.f64}\left(\left(6 \cdot \frac{2}{3}\right), \left(\left(\mathsf{neg}\left(z\right)\right) \cdot 6\right)\right)\right)\right) \]
                  10. metadata-evalN/A

                    \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(y, x\right), \mathsf{+.f64}\left(4, \left(\color{blue}{\left(\mathsf{neg}\left(z\right)\right)} \cdot 6\right)\right)\right)\right) \]
                  11. distribute-lft-neg-outN/A

                    \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(y, x\right), \mathsf{+.f64}\left(4, \left(\mathsf{neg}\left(z \cdot 6\right)\right)\right)\right)\right) \]
                  12. distribute-rgt-neg-inN/A

                    \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(y, x\right), \mathsf{+.f64}\left(4, \left(z \cdot \color{blue}{\left(\mathsf{neg}\left(6\right)\right)}\right)\right)\right)\right) \]
                  13. metadata-evalN/A

                    \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(y, x\right), \mathsf{+.f64}\left(4, \left(z \cdot -6\right)\right)\right)\right) \]
                  14. metadata-evalN/A

                    \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(y, x\right), \mathsf{+.f64}\left(4, \left(z \cdot \left(6 \cdot \color{blue}{-1}\right)\right)\right)\right)\right) \]
                  15. *-lowering-*.f64N/A

                    \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(y, x\right), \mathsf{+.f64}\left(4, \mathsf{*.f64}\left(z, \color{blue}{\left(6 \cdot -1\right)}\right)\right)\right)\right) \]
                  16. metadata-eval99.8%

                    \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(y, x\right), \mathsf{+.f64}\left(4, \mathsf{*.f64}\left(z, -6\right)\right)\right)\right) \]
                3. Simplified99.8%

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

                  \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(y, x\right), \color{blue}{4}\right)\right) \]
                6. Step-by-step derivation
                  1. Simplified99.1%

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

                  if 0.57999999999999996 < z

                  1. Initial program 99.8%

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

                    \[\leadsto \color{blue}{-6 \cdot \left(z \cdot \left(y - x\right)\right)} \]
                  4. Step-by-step derivation
                    1. associate-*r*N/A

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

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

                      \[\leadsto z \cdot \color{blue}{\left(-6 \cdot \left(y - x\right)\right)} \]
                    4. *-lowering-*.f64N/A

                      \[\leadsto \mathsf{*.f64}\left(z, \color{blue}{\left(-6 \cdot \left(y - x\right)\right)}\right) \]
                    5. *-lowering-*.f64N/A

                      \[\leadsto \mathsf{*.f64}\left(z, \mathsf{*.f64}\left(-6, \color{blue}{\left(y - x\right)}\right)\right) \]
                    6. --lowering--.f6498.8%

                      \[\leadsto \mathsf{*.f64}\left(z, \mathsf{*.f64}\left(-6, \mathsf{\_.f64}\left(y, \color{blue}{x}\right)\right)\right) \]
                  5. Simplified98.8%

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

                  \[\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.58:\\ \;\;\;\;x + \left(y - x\right) \cdot 4\\ \mathbf{else}:\\ \;\;\;\;z \cdot \left(\left(y - x\right) \cdot -6\right)\\ \end{array} \]
                9. Add Preprocessing

                Alternative 9: 75.0% accurate, 0.8× speedup?

                \[\begin{array}{l} \\ \begin{array}{l} t_0 := y \cdot \left(4 + z \cdot -6\right)\\ \mathbf{if}\;y \leq -5.2 \cdot 10^{+15}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;y \leq 5.5 \cdot 10^{+57}:\\ \;\;\;\;x \cdot \left(z \cdot 6 + -3\right)\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
                (FPCore (x y z)
                 :precision binary64
                 (let* ((t_0 (* y (+ 4.0 (* z -6.0)))))
                   (if (<= y -5.2e+15) t_0 (if (<= y 5.5e+57) (* x (+ (* z 6.0) -3.0)) t_0))))
                double code(double x, double y, double z) {
                	double t_0 = y * (4.0 + (z * -6.0));
                	double tmp;
                	if (y <= -5.2e+15) {
                		tmp = t_0;
                	} else if (y <= 5.5e+57) {
                		tmp = x * ((z * 6.0) + -3.0);
                	} else {
                		tmp = t_0;
                	}
                	return tmp;
                }
                
                real(8) function code(x, y, z)
                    real(8), intent (in) :: x
                    real(8), intent (in) :: y
                    real(8), intent (in) :: z
                    real(8) :: t_0
                    real(8) :: tmp
                    t_0 = y * (4.0d0 + (z * (-6.0d0)))
                    if (y <= (-5.2d+15)) then
                        tmp = t_0
                    else if (y <= 5.5d+57) then
                        tmp = x * ((z * 6.0d0) + (-3.0d0))
                    else
                        tmp = t_0
                    end if
                    code = tmp
                end function
                
                public static double code(double x, double y, double z) {
                	double t_0 = y * (4.0 + (z * -6.0));
                	double tmp;
                	if (y <= -5.2e+15) {
                		tmp = t_0;
                	} else if (y <= 5.5e+57) {
                		tmp = x * ((z * 6.0) + -3.0);
                	} else {
                		tmp = t_0;
                	}
                	return tmp;
                }
                
                def code(x, y, z):
                	t_0 = y * (4.0 + (z * -6.0))
                	tmp = 0
                	if y <= -5.2e+15:
                		tmp = t_0
                	elif y <= 5.5e+57:
                		tmp = x * ((z * 6.0) + -3.0)
                	else:
                		tmp = t_0
                	return tmp
                
                function code(x, y, z)
                	t_0 = Float64(y * Float64(4.0 + Float64(z * -6.0)))
                	tmp = 0.0
                	if (y <= -5.2e+15)
                		tmp = t_0;
                	elseif (y <= 5.5e+57)
                		tmp = Float64(x * Float64(Float64(z * 6.0) + -3.0));
                	else
                		tmp = t_0;
                	end
                	return tmp
                end
                
                function tmp_2 = code(x, y, z)
                	t_0 = y * (4.0 + (z * -6.0));
                	tmp = 0.0;
                	if (y <= -5.2e+15)
                		tmp = t_0;
                	elseif (y <= 5.5e+57)
                		tmp = x * ((z * 6.0) + -3.0);
                	else
                		tmp = t_0;
                	end
                	tmp_2 = tmp;
                end
                
                code[x_, y_, z_] := Block[{t$95$0 = N[(y * N[(4.0 + N[(z * -6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -5.2e+15], t$95$0, If[LessEqual[y, 5.5e+57], N[(x * N[(N[(z * 6.0), $MachinePrecision] + -3.0), $MachinePrecision]), $MachinePrecision], t$95$0]]]
                
                \begin{array}{l}
                
                \\
                \begin{array}{l}
                t_0 := y \cdot \left(4 + z \cdot -6\right)\\
                \mathbf{if}\;y \leq -5.2 \cdot 10^{+15}:\\
                \;\;\;\;t\_0\\
                
                \mathbf{elif}\;y \leq 5.5 \cdot 10^{+57}:\\
                \;\;\;\;x \cdot \left(z \cdot 6 + -3\right)\\
                
                \mathbf{else}:\\
                \;\;\;\;t\_0\\
                
                
                \end{array}
                \end{array}
                
                Derivation
                1. Split input into 2 regimes
                2. if y < -5.2e15 or 5.5000000000000002e57 < 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. +-lowering-+.f64N/A

                      \[\leadsto \mathsf{+.f64}\left(x, \color{blue}{\left(\left(\left(y - x\right) \cdot 6\right) \cdot \left(\frac{2}{3} - z\right)\right)}\right) \]
                    2. associate-*l*N/A

                      \[\leadsto \mathsf{+.f64}\left(x, \left(\left(y - x\right) \cdot \color{blue}{\left(6 \cdot \left(\frac{2}{3} - z\right)\right)}\right)\right) \]
                    3. *-lowering-*.f64N/A

                      \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(\left(y - x\right), \color{blue}{\left(6 \cdot \left(\frac{2}{3} - z\right)\right)}\right)\right) \]
                    4. --lowering--.f64N/A

                      \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(y, x\right), \left(\color{blue}{6} \cdot \left(\frac{2}{3} - z\right)\right)\right)\right) \]
                    5. sub-negN/A

                      \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(y, x\right), \left(6 \cdot \left(\frac{2}{3} + \color{blue}{\left(\mathsf{neg}\left(z\right)\right)}\right)\right)\right)\right) \]
                    6. distribute-lft-inN/A

                      \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(y, x\right), \left(6 \cdot \frac{2}{3} + \color{blue}{6 \cdot \left(\mathsf{neg}\left(z\right)\right)}\right)\right)\right) \]
                    7. *-commutativeN/A

                      \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(y, x\right), \left(6 \cdot \frac{2}{3} + \left(\mathsf{neg}\left(z\right)\right) \cdot \color{blue}{6}\right)\right)\right) \]
                    8. +-lowering-+.f64N/A

                      \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(y, x\right), \mathsf{+.f64}\left(\left(6 \cdot \frac{2}{3}\right), \color{blue}{\left(\left(\mathsf{neg}\left(z\right)\right) \cdot 6\right)}\right)\right)\right) \]
                    9. metadata-evalN/A

                      \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(y, x\right), \mathsf{+.f64}\left(\left(6 \cdot \frac{2}{3}\right), \left(\left(\mathsf{neg}\left(z\right)\right) \cdot 6\right)\right)\right)\right) \]
                    10. metadata-evalN/A

                      \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(y, x\right), \mathsf{+.f64}\left(4, \left(\color{blue}{\left(\mathsf{neg}\left(z\right)\right)} \cdot 6\right)\right)\right)\right) \]
                    11. distribute-lft-neg-outN/A

                      \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(y, x\right), \mathsf{+.f64}\left(4, \left(\mathsf{neg}\left(z \cdot 6\right)\right)\right)\right)\right) \]
                    12. distribute-rgt-neg-inN/A

                      \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(y, x\right), \mathsf{+.f64}\left(4, \left(z \cdot \color{blue}{\left(\mathsf{neg}\left(6\right)\right)}\right)\right)\right)\right) \]
                    13. metadata-evalN/A

                      \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(y, x\right), \mathsf{+.f64}\left(4, \left(z \cdot -6\right)\right)\right)\right) \]
                    14. metadata-evalN/A

                      \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(y, x\right), \mathsf{+.f64}\left(4, \left(z \cdot \left(6 \cdot \color{blue}{-1}\right)\right)\right)\right)\right) \]
                    15. *-lowering-*.f64N/A

                      \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(y, x\right), \mathsf{+.f64}\left(4, \mathsf{*.f64}\left(z, \color{blue}{\left(6 \cdot -1\right)}\right)\right)\right)\right) \]
                    16. metadata-eval99.9%

                      \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(y, x\right), \mathsf{+.f64}\left(4, \mathsf{*.f64}\left(z, -6\right)\right)\right)\right) \]
                  3. Simplified99.9%

                    \[\leadsto \color{blue}{x + \left(y - x\right) \cdot \left(4 + z \cdot -6\right)} \]
                  4. Add Preprocessing
                  5. Step-by-step derivation
                    1. flip3-+N/A

                      \[\leadsto \mathsf{+.f64}\left(x, \left(\left(y - x\right) \cdot \frac{{4}^{3} + {\left(z \cdot -6\right)}^{3}}{\color{blue}{4 \cdot 4 + \left(\left(z \cdot -6\right) \cdot \left(z \cdot -6\right) - 4 \cdot \left(z \cdot -6\right)\right)}}\right)\right) \]
                    2. clear-numN/A

                      \[\leadsto \mathsf{+.f64}\left(x, \left(\left(y - x\right) \cdot \frac{1}{\color{blue}{\frac{4 \cdot 4 + \left(\left(z \cdot -6\right) \cdot \left(z \cdot -6\right) - 4 \cdot \left(z \cdot -6\right)\right)}{{4}^{3} + {\left(z \cdot -6\right)}^{3}}}}\right)\right) \]
                    3. un-div-invN/A

                      \[\leadsto \mathsf{+.f64}\left(x, \left(\frac{y - x}{\color{blue}{\frac{4 \cdot 4 + \left(\left(z \cdot -6\right) \cdot \left(z \cdot -6\right) - 4 \cdot \left(z \cdot -6\right)\right)}{{4}^{3} + {\left(z \cdot -6\right)}^{3}}}}\right)\right) \]
                    4. /-lowering-/.f64N/A

                      \[\leadsto \mathsf{+.f64}\left(x, \mathsf{/.f64}\left(\left(y - x\right), \color{blue}{\left(\frac{4 \cdot 4 + \left(\left(z \cdot -6\right) \cdot \left(z \cdot -6\right) - 4 \cdot \left(z \cdot -6\right)\right)}{{4}^{3} + {\left(z \cdot -6\right)}^{3}}\right)}\right)\right) \]
                    5. --lowering--.f64N/A

                      \[\leadsto \mathsf{+.f64}\left(x, \mathsf{/.f64}\left(\mathsf{\_.f64}\left(y, x\right), \left(\frac{\color{blue}{4 \cdot 4 + \left(\left(z \cdot -6\right) \cdot \left(z \cdot -6\right) - 4 \cdot \left(z \cdot -6\right)\right)}}{{4}^{3} + {\left(z \cdot -6\right)}^{3}}\right)\right)\right) \]
                    6. clear-numN/A

                      \[\leadsto \mathsf{+.f64}\left(x, \mathsf{/.f64}\left(\mathsf{\_.f64}\left(y, x\right), \left(\frac{1}{\color{blue}{\frac{{4}^{3} + {\left(z \cdot -6\right)}^{3}}{4 \cdot 4 + \left(\left(z \cdot -6\right) \cdot \left(z \cdot -6\right) - 4 \cdot \left(z \cdot -6\right)\right)}}}\right)\right)\right) \]
                    7. flip3-+N/A

                      \[\leadsto \mathsf{+.f64}\left(x, \mathsf{/.f64}\left(\mathsf{\_.f64}\left(y, x\right), \left(\frac{1}{4 + \color{blue}{z \cdot -6}}\right)\right)\right) \]
                    8. /-lowering-/.f64N/A

                      \[\leadsto \mathsf{+.f64}\left(x, \mathsf{/.f64}\left(\mathsf{\_.f64}\left(y, x\right), \mathsf{/.f64}\left(1, \color{blue}{\left(4 + z \cdot -6\right)}\right)\right)\right) \]
                    9. +-lowering-+.f64N/A

                      \[\leadsto \mathsf{+.f64}\left(x, \mathsf{/.f64}\left(\mathsf{\_.f64}\left(y, x\right), \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(4, \color{blue}{\left(z \cdot -6\right)}\right)\right)\right)\right) \]
                    10. *-lowering-*.f6499.8%

                      \[\leadsto \mathsf{+.f64}\left(x, \mathsf{/.f64}\left(\mathsf{\_.f64}\left(y, x\right), \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(4, \mathsf{*.f64}\left(z, \color{blue}{-6}\right)\right)\right)\right)\right) \]
                  6. Applied egg-rr99.8%

                    \[\leadsto x + \color{blue}{\frac{y - x}{\frac{1}{4 + z \cdot -6}}} \]
                  7. Taylor expanded in x around 0

                    \[\leadsto \color{blue}{y \cdot \left(4 + -6 \cdot z\right)} \]
                  8. Step-by-step derivation
                    1. *-lowering-*.f64N/A

                      \[\leadsto \mathsf{*.f64}\left(y, \color{blue}{\left(4 + -6 \cdot z\right)}\right) \]
                    2. +-lowering-+.f64N/A

                      \[\leadsto \mathsf{*.f64}\left(y, \mathsf{+.f64}\left(4, \color{blue}{\left(-6 \cdot z\right)}\right)\right) \]
                    3. *-lowering-*.f6489.4%

                      \[\leadsto \mathsf{*.f64}\left(y, \mathsf{+.f64}\left(4, \mathsf{*.f64}\left(-6, \color{blue}{z}\right)\right)\right) \]
                  9. Simplified89.4%

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

                  if -5.2e15 < y < 5.5000000000000002e57

                  1. Initial program 99.5%

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

                    \[\leadsto \color{blue}{x \cdot \left(1 + -6 \cdot \left(\frac{2}{3} - z\right)\right)} \]
                  4. Step-by-step derivation
                    1. *-lowering-*.f64N/A

                      \[\leadsto \mathsf{*.f64}\left(x, \color{blue}{\left(1 + -6 \cdot \left(\frac{2}{3} - z\right)\right)}\right) \]
                    2. +-commutativeN/A

                      \[\leadsto \mathsf{*.f64}\left(x, \left(-6 \cdot \left(\frac{2}{3} - z\right) + \color{blue}{1}\right)\right) \]
                    3. sub-negN/A

                      \[\leadsto \mathsf{*.f64}\left(x, \left(-6 \cdot \left(\frac{2}{3} + \left(\mathsf{neg}\left(z\right)\right)\right) + 1\right)\right) \]
                    4. mul-1-negN/A

                      \[\leadsto \mathsf{*.f64}\left(x, \left(-6 \cdot \left(\frac{2}{3} + -1 \cdot z\right) + 1\right)\right) \]
                    5. +-commutativeN/A

                      \[\leadsto \mathsf{*.f64}\left(x, \left(-6 \cdot \left(-1 \cdot z + \frac{2}{3}\right) + 1\right)\right) \]
                    6. distribute-lft-inN/A

                      \[\leadsto \mathsf{*.f64}\left(x, \left(\left(-6 \cdot \left(-1 \cdot z\right) + -6 \cdot \frac{2}{3}\right) + 1\right)\right) \]
                    7. *-commutativeN/A

                      \[\leadsto \mathsf{*.f64}\left(x, \left(\left(-6 \cdot \left(z \cdot -1\right) + -6 \cdot \frac{2}{3}\right) + 1\right)\right) \]
                    8. associate-*l*N/A

                      \[\leadsto \mathsf{*.f64}\left(x, \left(\left(\left(-6 \cdot z\right) \cdot -1 + -6 \cdot \frac{2}{3}\right) + 1\right)\right) \]
                    9. metadata-evalN/A

                      \[\leadsto \mathsf{*.f64}\left(x, \left(\left(\left(-6 \cdot z\right) \cdot -1 + -4\right) + 1\right)\right) \]
                    10. associate-+l+N/A

                      \[\leadsto \mathsf{*.f64}\left(x, \left(\left(-6 \cdot z\right) \cdot -1 + \color{blue}{\left(-4 + 1\right)}\right)\right) \]
                    11. metadata-evalN/A

                      \[\leadsto \mathsf{*.f64}\left(x, \left(\left(-6 \cdot z\right) \cdot -1 + -3\right)\right) \]
                    12. metadata-evalN/A

                      \[\leadsto \mathsf{*.f64}\left(x, \left(\left(-6 \cdot z\right) \cdot -1 + \left(1 + \color{blue}{-4}\right)\right)\right) \]
                    13. +-lowering-+.f64N/A

                      \[\leadsto \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\left(\left(-6 \cdot z\right) \cdot -1\right), \color{blue}{\left(1 + -4\right)}\right)\right) \]
                    14. *-commutativeN/A

                      \[\leadsto \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\left(-1 \cdot \left(-6 \cdot z\right)\right), \left(\color{blue}{1} + -4\right)\right)\right) \]
                    15. associate-*r*N/A

                      \[\leadsto \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\left(\left(-1 \cdot -6\right) \cdot z\right), \left(\color{blue}{1} + -4\right)\right)\right) \]
                    16. metadata-evalN/A

                      \[\leadsto \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\left(6 \cdot z\right), \left(1 + -4\right)\right)\right) \]
                    17. *-lowering-*.f64N/A

                      \[\leadsto \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\mathsf{*.f64}\left(6, z\right), \left(\color{blue}{1} + -4\right)\right)\right) \]
                    18. metadata-eval75.6%

                      \[\leadsto \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\mathsf{*.f64}\left(6, z\right), -3\right)\right) \]
                  5. Simplified75.6%

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

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

                Alternative 10: 74.9% accurate, 0.8× speedup?

                \[\begin{array}{l} \\ \begin{array}{l} t_0 := 6 \cdot \left(y \cdot \left(0.6666666666666666 - z\right)\right)\\ \mathbf{if}\;y \leq -6.5 \cdot 10^{+17}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;y \leq 1.6 \cdot 10^{+59}:\\ \;\;\;\;x \cdot \left(z \cdot 6 + -3\right)\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
                (FPCore (x y z)
                 :precision binary64
                 (let* ((t_0 (* 6.0 (* y (- 0.6666666666666666 z)))))
                   (if (<= y -6.5e+17) t_0 (if (<= y 1.6e+59) (* x (+ (* z 6.0) -3.0)) t_0))))
                double code(double x, double y, double z) {
                	double t_0 = 6.0 * (y * (0.6666666666666666 - z));
                	double tmp;
                	if (y <= -6.5e+17) {
                		tmp = t_0;
                	} else if (y <= 1.6e+59) {
                		tmp = x * ((z * 6.0) + -3.0);
                	} else {
                		tmp = t_0;
                	}
                	return tmp;
                }
                
                real(8) function code(x, y, z)
                    real(8), intent (in) :: x
                    real(8), intent (in) :: y
                    real(8), intent (in) :: z
                    real(8) :: t_0
                    real(8) :: tmp
                    t_0 = 6.0d0 * (y * (0.6666666666666666d0 - z))
                    if (y <= (-6.5d+17)) then
                        tmp = t_0
                    else if (y <= 1.6d+59) then
                        tmp = x * ((z * 6.0d0) + (-3.0d0))
                    else
                        tmp = t_0
                    end if
                    code = tmp
                end function
                
                public static double code(double x, double y, double z) {
                	double t_0 = 6.0 * (y * (0.6666666666666666 - z));
                	double tmp;
                	if (y <= -6.5e+17) {
                		tmp = t_0;
                	} else if (y <= 1.6e+59) {
                		tmp = x * ((z * 6.0) + -3.0);
                	} else {
                		tmp = t_0;
                	}
                	return tmp;
                }
                
                def code(x, y, z):
                	t_0 = 6.0 * (y * (0.6666666666666666 - z))
                	tmp = 0
                	if y <= -6.5e+17:
                		tmp = t_0
                	elif y <= 1.6e+59:
                		tmp = x * ((z * 6.0) + -3.0)
                	else:
                		tmp = t_0
                	return tmp
                
                function code(x, y, z)
                	t_0 = Float64(6.0 * Float64(y * Float64(0.6666666666666666 - z)))
                	tmp = 0.0
                	if (y <= -6.5e+17)
                		tmp = t_0;
                	elseif (y <= 1.6e+59)
                		tmp = Float64(x * Float64(Float64(z * 6.0) + -3.0));
                	else
                		tmp = t_0;
                	end
                	return tmp
                end
                
                function tmp_2 = code(x, y, z)
                	t_0 = 6.0 * (y * (0.6666666666666666 - z));
                	tmp = 0.0;
                	if (y <= -6.5e+17)
                		tmp = t_0;
                	elseif (y <= 1.6e+59)
                		tmp = x * ((z * 6.0) + -3.0);
                	else
                		tmp = t_0;
                	end
                	tmp_2 = tmp;
                end
                
                code[x_, y_, z_] := Block[{t$95$0 = N[(6.0 * N[(y * N[(0.6666666666666666 - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -6.5e+17], t$95$0, If[LessEqual[y, 1.6e+59], N[(x * N[(N[(z * 6.0), $MachinePrecision] + -3.0), $MachinePrecision]), $MachinePrecision], t$95$0]]]
                
                \begin{array}{l}
                
                \\
                \begin{array}{l}
                t_0 := 6 \cdot \left(y \cdot \left(0.6666666666666666 - z\right)\right)\\
                \mathbf{if}\;y \leq -6.5 \cdot 10^{+17}:\\
                \;\;\;\;t\_0\\
                
                \mathbf{elif}\;y \leq 1.6 \cdot 10^{+59}:\\
                \;\;\;\;x \cdot \left(z \cdot 6 + -3\right)\\
                
                \mathbf{else}:\\
                \;\;\;\;t\_0\\
                
                
                \end{array}
                \end{array}
                
                Derivation
                1. Split input into 2 regimes
                2. if y < -6.5e17 or 1.59999999999999991e59 < y

                  1. Initial program 99.7%

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

                    \[\leadsto \color{blue}{6 \cdot \left(y \cdot \left(\frac{2}{3} - z\right)\right)} \]
                  4. Step-by-step derivation
                    1. *-lowering-*.f64N/A

                      \[\leadsto \mathsf{*.f64}\left(6, \color{blue}{\left(y \cdot \left(\frac{2}{3} - z\right)\right)}\right) \]
                    2. *-lowering-*.f64N/A

                      \[\leadsto \mathsf{*.f64}\left(6, \mathsf{*.f64}\left(y, \color{blue}{\left(\frac{2}{3} - z\right)}\right)\right) \]
                    3. --lowering--.f6489.2%

                      \[\leadsto \mathsf{*.f64}\left(6, \mathsf{*.f64}\left(y, \mathsf{\_.f64}\left(\frac{2}{3}, \color{blue}{z}\right)\right)\right) \]
                  5. Simplified89.2%

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

                  if -6.5e17 < y < 1.59999999999999991e59

                  1. Initial program 99.5%

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

                    \[\leadsto \color{blue}{x \cdot \left(1 + -6 \cdot \left(\frac{2}{3} - z\right)\right)} \]
                  4. Step-by-step derivation
                    1. *-lowering-*.f64N/A

                      \[\leadsto \mathsf{*.f64}\left(x, \color{blue}{\left(1 + -6 \cdot \left(\frac{2}{3} - z\right)\right)}\right) \]
                    2. +-commutativeN/A

                      \[\leadsto \mathsf{*.f64}\left(x, \left(-6 \cdot \left(\frac{2}{3} - z\right) + \color{blue}{1}\right)\right) \]
                    3. sub-negN/A

                      \[\leadsto \mathsf{*.f64}\left(x, \left(-6 \cdot \left(\frac{2}{3} + \left(\mathsf{neg}\left(z\right)\right)\right) + 1\right)\right) \]
                    4. mul-1-negN/A

                      \[\leadsto \mathsf{*.f64}\left(x, \left(-6 \cdot \left(\frac{2}{3} + -1 \cdot z\right) + 1\right)\right) \]
                    5. +-commutativeN/A

                      \[\leadsto \mathsf{*.f64}\left(x, \left(-6 \cdot \left(-1 \cdot z + \frac{2}{3}\right) + 1\right)\right) \]
                    6. distribute-lft-inN/A

                      \[\leadsto \mathsf{*.f64}\left(x, \left(\left(-6 \cdot \left(-1 \cdot z\right) + -6 \cdot \frac{2}{3}\right) + 1\right)\right) \]
                    7. *-commutativeN/A

                      \[\leadsto \mathsf{*.f64}\left(x, \left(\left(-6 \cdot \left(z \cdot -1\right) + -6 \cdot \frac{2}{3}\right) + 1\right)\right) \]
                    8. associate-*l*N/A

                      \[\leadsto \mathsf{*.f64}\left(x, \left(\left(\left(-6 \cdot z\right) \cdot -1 + -6 \cdot \frac{2}{3}\right) + 1\right)\right) \]
                    9. metadata-evalN/A

                      \[\leadsto \mathsf{*.f64}\left(x, \left(\left(\left(-6 \cdot z\right) \cdot -1 + -4\right) + 1\right)\right) \]
                    10. associate-+l+N/A

                      \[\leadsto \mathsf{*.f64}\left(x, \left(\left(-6 \cdot z\right) \cdot -1 + \color{blue}{\left(-4 + 1\right)}\right)\right) \]
                    11. metadata-evalN/A

                      \[\leadsto \mathsf{*.f64}\left(x, \left(\left(-6 \cdot z\right) \cdot -1 + -3\right)\right) \]
                    12. metadata-evalN/A

                      \[\leadsto \mathsf{*.f64}\left(x, \left(\left(-6 \cdot z\right) \cdot -1 + \left(1 + \color{blue}{-4}\right)\right)\right) \]
                    13. +-lowering-+.f64N/A

                      \[\leadsto \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\left(\left(-6 \cdot z\right) \cdot -1\right), \color{blue}{\left(1 + -4\right)}\right)\right) \]
                    14. *-commutativeN/A

                      \[\leadsto \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\left(-1 \cdot \left(-6 \cdot z\right)\right), \left(\color{blue}{1} + -4\right)\right)\right) \]
                    15. associate-*r*N/A

                      \[\leadsto \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\left(\left(-1 \cdot -6\right) \cdot z\right), \left(\color{blue}{1} + -4\right)\right)\right) \]
                    16. metadata-evalN/A

                      \[\leadsto \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\left(6 \cdot z\right), \left(1 + -4\right)\right)\right) \]
                    17. *-lowering-*.f64N/A

                      \[\leadsto \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\mathsf{*.f64}\left(6, z\right), \left(\color{blue}{1} + -4\right)\right)\right) \]
                    18. metadata-eval75.6%

                      \[\leadsto \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\mathsf{*.f64}\left(6, z\right), -3\right)\right) \]
                  5. Simplified75.6%

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

                  \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -6.5 \cdot 10^{+17}:\\ \;\;\;\;6 \cdot \left(y \cdot \left(0.6666666666666666 - z\right)\right)\\ \mathbf{elif}\;y \leq 1.6 \cdot 10^{+59}:\\ \;\;\;\;x \cdot \left(z \cdot 6 + -3\right)\\ \mathbf{else}:\\ \;\;\;\;6 \cdot \left(y \cdot \left(0.6666666666666666 - z\right)\right)\\ \end{array} \]
                5. Add Preprocessing

                Alternative 11: 37.3% accurate, 1.0× speedup?

                \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -1.2 \cdot 10^{+31}:\\ \;\;\;\;y \cdot 4\\ \mathbf{elif}\;y \leq 1.3 \cdot 10^{+142}:\\ \;\;\;\;x \cdot -3\\ \mathbf{else}:\\ \;\;\;\;y \cdot 4\\ \end{array} \end{array} \]
                (FPCore (x y z)
                 :precision binary64
                 (if (<= y -1.2e+31) (* y 4.0) (if (<= y 1.3e+142) (* x -3.0) (* y 4.0))))
                double code(double x, double y, double z) {
                	double tmp;
                	if (y <= -1.2e+31) {
                		tmp = y * 4.0;
                	} else if (y <= 1.3e+142) {
                		tmp = x * -3.0;
                	} else {
                		tmp = y * 4.0;
                	}
                	return tmp;
                }
                
                real(8) function code(x, y, z)
                    real(8), intent (in) :: x
                    real(8), intent (in) :: y
                    real(8), intent (in) :: z
                    real(8) :: tmp
                    if (y <= (-1.2d+31)) then
                        tmp = y * 4.0d0
                    else if (y <= 1.3d+142) then
                        tmp = x * (-3.0d0)
                    else
                        tmp = y * 4.0d0
                    end if
                    code = tmp
                end function
                
                public static double code(double x, double y, double z) {
                	double tmp;
                	if (y <= -1.2e+31) {
                		tmp = y * 4.0;
                	} else if (y <= 1.3e+142) {
                		tmp = x * -3.0;
                	} else {
                		tmp = y * 4.0;
                	}
                	return tmp;
                }
                
                def code(x, y, z):
                	tmp = 0
                	if y <= -1.2e+31:
                		tmp = y * 4.0
                	elif y <= 1.3e+142:
                		tmp = x * -3.0
                	else:
                		tmp = y * 4.0
                	return tmp
                
                function code(x, y, z)
                	tmp = 0.0
                	if (y <= -1.2e+31)
                		tmp = Float64(y * 4.0);
                	elseif (y <= 1.3e+142)
                		tmp = Float64(x * -3.0);
                	else
                		tmp = Float64(y * 4.0);
                	end
                	return tmp
                end
                
                function tmp_2 = code(x, y, z)
                	tmp = 0.0;
                	if (y <= -1.2e+31)
                		tmp = y * 4.0;
                	elseif (y <= 1.3e+142)
                		tmp = x * -3.0;
                	else
                		tmp = y * 4.0;
                	end
                	tmp_2 = tmp;
                end
                
                code[x_, y_, z_] := If[LessEqual[y, -1.2e+31], N[(y * 4.0), $MachinePrecision], If[LessEqual[y, 1.3e+142], N[(x * -3.0), $MachinePrecision], N[(y * 4.0), $MachinePrecision]]]
                
                \begin{array}{l}
                
                \\
                \begin{array}{l}
                \mathbf{if}\;y \leq -1.2 \cdot 10^{+31}:\\
                \;\;\;\;y \cdot 4\\
                
                \mathbf{elif}\;y \leq 1.3 \cdot 10^{+142}:\\
                \;\;\;\;x \cdot -3\\
                
                \mathbf{else}:\\
                \;\;\;\;y \cdot 4\\
                
                
                \end{array}
                \end{array}
                
                Derivation
                1. Split input into 2 regimes
                2. if y < -1.19999999999999991e31 or 1.30000000000000011e142 < y

                  1. Initial program 99.7%

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

                    \[\leadsto \color{blue}{6 \cdot \left(y \cdot \left(\frac{2}{3} - z\right)\right)} \]
                  4. Step-by-step derivation
                    1. *-lowering-*.f64N/A

                      \[\leadsto \mathsf{*.f64}\left(6, \color{blue}{\left(y \cdot \left(\frac{2}{3} - z\right)\right)}\right) \]
                    2. *-lowering-*.f64N/A

                      \[\leadsto \mathsf{*.f64}\left(6, \mathsf{*.f64}\left(y, \color{blue}{\left(\frac{2}{3} - z\right)}\right)\right) \]
                    3. --lowering--.f6493.1%

                      \[\leadsto \mathsf{*.f64}\left(6, \mathsf{*.f64}\left(y, \mathsf{\_.f64}\left(\frac{2}{3}, \color{blue}{z}\right)\right)\right) \]
                  5. Simplified93.1%

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

                    \[\leadsto \color{blue}{4 \cdot y} \]
                  7. Step-by-step derivation
                    1. *-commutativeN/A

                      \[\leadsto y \cdot \color{blue}{4} \]
                    2. *-lowering-*.f6449.5%

                      \[\leadsto \mathsf{*.f64}\left(y, \color{blue}{4}\right) \]
                  8. Simplified49.5%

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

                  if -1.19999999999999991e31 < y < 1.30000000000000011e142

                  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. +-lowering-+.f64N/A

                      \[\leadsto \mathsf{+.f64}\left(x, \color{blue}{\left(\left(\left(y - x\right) \cdot 6\right) \cdot \left(\frac{2}{3} - z\right)\right)}\right) \]
                    2. associate-*l*N/A

                      \[\leadsto \mathsf{+.f64}\left(x, \left(\left(y - x\right) \cdot \color{blue}{\left(6 \cdot \left(\frac{2}{3} - z\right)\right)}\right)\right) \]
                    3. *-lowering-*.f64N/A

                      \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(\left(y - x\right), \color{blue}{\left(6 \cdot \left(\frac{2}{3} - z\right)\right)}\right)\right) \]
                    4. --lowering--.f64N/A

                      \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(y, x\right), \left(\color{blue}{6} \cdot \left(\frac{2}{3} - z\right)\right)\right)\right) \]
                    5. sub-negN/A

                      \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(y, x\right), \left(6 \cdot \left(\frac{2}{3} + \color{blue}{\left(\mathsf{neg}\left(z\right)\right)}\right)\right)\right)\right) \]
                    6. distribute-lft-inN/A

                      \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(y, x\right), \left(6 \cdot \frac{2}{3} + \color{blue}{6 \cdot \left(\mathsf{neg}\left(z\right)\right)}\right)\right)\right) \]
                    7. *-commutativeN/A

                      \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(y, x\right), \left(6 \cdot \frac{2}{3} + \left(\mathsf{neg}\left(z\right)\right) \cdot \color{blue}{6}\right)\right)\right) \]
                    8. +-lowering-+.f64N/A

                      \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(y, x\right), \mathsf{+.f64}\left(\left(6 \cdot \frac{2}{3}\right), \color{blue}{\left(\left(\mathsf{neg}\left(z\right)\right) \cdot 6\right)}\right)\right)\right) \]
                    9. metadata-evalN/A

                      \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(y, x\right), \mathsf{+.f64}\left(\left(6 \cdot \frac{2}{3}\right), \left(\left(\mathsf{neg}\left(z\right)\right) \cdot 6\right)\right)\right)\right) \]
                    10. metadata-evalN/A

                      \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(y, x\right), \mathsf{+.f64}\left(4, \left(\color{blue}{\left(\mathsf{neg}\left(z\right)\right)} \cdot 6\right)\right)\right)\right) \]
                    11. distribute-lft-neg-outN/A

                      \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(y, x\right), \mathsf{+.f64}\left(4, \left(\mathsf{neg}\left(z \cdot 6\right)\right)\right)\right)\right) \]
                    12. distribute-rgt-neg-inN/A

                      \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(y, x\right), \mathsf{+.f64}\left(4, \left(z \cdot \color{blue}{\left(\mathsf{neg}\left(6\right)\right)}\right)\right)\right)\right) \]
                    13. metadata-evalN/A

                      \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(y, x\right), \mathsf{+.f64}\left(4, \left(z \cdot -6\right)\right)\right)\right) \]
                    14. metadata-evalN/A

                      \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(y, x\right), \mathsf{+.f64}\left(4, \left(z \cdot \left(6 \cdot \color{blue}{-1}\right)\right)\right)\right)\right) \]
                    15. *-lowering-*.f64N/A

                      \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(y, x\right), \mathsf{+.f64}\left(4, \mathsf{*.f64}\left(z, \color{blue}{\left(6 \cdot -1\right)}\right)\right)\right)\right) \]
                    16. metadata-eval99.7%

                      \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(y, x\right), \mathsf{+.f64}\left(4, \mathsf{*.f64}\left(z, -6\right)\right)\right)\right) \]
                  3. Simplified99.7%

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

                    \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(y, x\right), \color{blue}{4}\right)\right) \]
                  6. Step-by-step derivation
                    1. Simplified43.3%

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

                      \[\leadsto \color{blue}{-3 \cdot x} \]
                    3. Step-by-step derivation
                      1. *-commutativeN/A

                        \[\leadsto x \cdot \color{blue}{-3} \]
                      2. *-lowering-*.f6432.8%

                        \[\leadsto \mathsf{*.f64}\left(x, \color{blue}{-3}\right) \]
                    4. Simplified32.8%

                      \[\leadsto \color{blue}{x \cdot -3} \]
                  7. Recombined 2 regimes into one program.
                  8. Add Preprocessing

                  Alternative 12: 99.5% accurate, 1.2× speedup?

                  \[\begin{array}{l} \\ x + \left(\left(y - x\right) \cdot \left(0.6666666666666666 - z\right)\right) \cdot 6 \end{array} \]
                  (FPCore (x y z)
                   :precision binary64
                   (+ x (* (* (- y x) (- 0.6666666666666666 z)) 6.0)))
                  double code(double x, double y, double z) {
                  	return x + (((y - x) * (0.6666666666666666 - z)) * 6.0);
                  }
                  
                  real(8) function code(x, y, z)
                      real(8), intent (in) :: x
                      real(8), intent (in) :: y
                      real(8), intent (in) :: z
                      code = x + (((y - x) * (0.6666666666666666d0 - z)) * 6.0d0)
                  end function
                  
                  public static double code(double x, double y, double z) {
                  	return x + (((y - x) * (0.6666666666666666 - z)) * 6.0);
                  }
                  
                  def code(x, y, z):
                  	return x + (((y - x) * (0.6666666666666666 - z)) * 6.0)
                  
                  function code(x, y, z)
                  	return Float64(x + Float64(Float64(Float64(y - x) * Float64(0.6666666666666666 - z)) * 6.0))
                  end
                  
                  function tmp = code(x, y, z)
                  	tmp = x + (((y - x) * (0.6666666666666666 - z)) * 6.0);
                  end
                  
                  code[x_, y_, z_] := N[(x + N[(N[(N[(y - x), $MachinePrecision] * N[(0.6666666666666666 - z), $MachinePrecision]), $MachinePrecision] * 6.0), $MachinePrecision]), $MachinePrecision]
                  
                  \begin{array}{l}
                  
                  \\
                  x + \left(\left(y - x\right) \cdot \left(0.6666666666666666 - z\right)\right) \cdot 6
                  \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. Add Preprocessing
                  3. Step-by-step derivation
                    1. *-commutativeN/A

                      \[\leadsto \mathsf{+.f64}\left(x, \left(\left(\frac{2}{3} - z\right) \cdot \color{blue}{\left(\left(y - x\right) \cdot 6\right)}\right)\right) \]
                    2. associate-*r*N/A

                      \[\leadsto \mathsf{+.f64}\left(x, \left(\left(\left(\frac{2}{3} - z\right) \cdot \left(y - x\right)\right) \cdot \color{blue}{6}\right)\right) \]
                    3. *-lowering-*.f64N/A

                      \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(\left(\left(\frac{2}{3} - z\right) \cdot \left(y - x\right)\right), \color{blue}{6}\right)\right) \]
                    4. *-lowering-*.f64N/A

                      \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\left(\frac{2}{3} - z\right), \left(y - x\right)\right), 6\right)\right) \]
                    5. --lowering--.f64N/A

                      \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{\_.f64}\left(\left(\frac{2}{3}\right), z\right), \left(y - x\right)\right), 6\right)\right) \]
                    6. metadata-evalN/A

                      \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{\_.f64}\left(\frac{2}{3}, z\right), \left(y - x\right)\right), 6\right)\right) \]
                    7. --lowering--.f6499.6%

                      \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{\_.f64}\left(\frac{2}{3}, z\right), \mathsf{\_.f64}\left(y, x\right)\right), 6\right)\right) \]
                  4. Applied egg-rr99.6%

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

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

                  Alternative 13: 26.4% 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. +-lowering-+.f64N/A

                      \[\leadsto \mathsf{+.f64}\left(x, \color{blue}{\left(\left(\left(y - x\right) \cdot 6\right) \cdot \left(\frac{2}{3} - z\right)\right)}\right) \]
                    2. associate-*l*N/A

                      \[\leadsto \mathsf{+.f64}\left(x, \left(\left(y - x\right) \cdot \color{blue}{\left(6 \cdot \left(\frac{2}{3} - z\right)\right)}\right)\right) \]
                    3. *-lowering-*.f64N/A

                      \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(\left(y - x\right), \color{blue}{\left(6 \cdot \left(\frac{2}{3} - z\right)\right)}\right)\right) \]
                    4. --lowering--.f64N/A

                      \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(y, x\right), \left(\color{blue}{6} \cdot \left(\frac{2}{3} - z\right)\right)\right)\right) \]
                    5. sub-negN/A

                      \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(y, x\right), \left(6 \cdot \left(\frac{2}{3} + \color{blue}{\left(\mathsf{neg}\left(z\right)\right)}\right)\right)\right)\right) \]
                    6. distribute-lft-inN/A

                      \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(y, x\right), \left(6 \cdot \frac{2}{3} + \color{blue}{6 \cdot \left(\mathsf{neg}\left(z\right)\right)}\right)\right)\right) \]
                    7. *-commutativeN/A

                      \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(y, x\right), \left(6 \cdot \frac{2}{3} + \left(\mathsf{neg}\left(z\right)\right) \cdot \color{blue}{6}\right)\right)\right) \]
                    8. +-lowering-+.f64N/A

                      \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(y, x\right), \mathsf{+.f64}\left(\left(6 \cdot \frac{2}{3}\right), \color{blue}{\left(\left(\mathsf{neg}\left(z\right)\right) \cdot 6\right)}\right)\right)\right) \]
                    9. metadata-evalN/A

                      \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(y, x\right), \mathsf{+.f64}\left(\left(6 \cdot \frac{2}{3}\right), \left(\left(\mathsf{neg}\left(z\right)\right) \cdot 6\right)\right)\right)\right) \]
                    10. metadata-evalN/A

                      \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(y, x\right), \mathsf{+.f64}\left(4, \left(\color{blue}{\left(\mathsf{neg}\left(z\right)\right)} \cdot 6\right)\right)\right)\right) \]
                    11. distribute-lft-neg-outN/A

                      \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(y, x\right), \mathsf{+.f64}\left(4, \left(\mathsf{neg}\left(z \cdot 6\right)\right)\right)\right)\right) \]
                    12. distribute-rgt-neg-inN/A

                      \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(y, x\right), \mathsf{+.f64}\left(4, \left(z \cdot \color{blue}{\left(\mathsf{neg}\left(6\right)\right)}\right)\right)\right)\right) \]
                    13. metadata-evalN/A

                      \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(y, x\right), \mathsf{+.f64}\left(4, \left(z \cdot -6\right)\right)\right)\right) \]
                    14. metadata-evalN/A

                      \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(y, x\right), \mathsf{+.f64}\left(4, \left(z \cdot \left(6 \cdot \color{blue}{-1}\right)\right)\right)\right)\right) \]
                    15. *-lowering-*.f64N/A

                      \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(y, x\right), \mathsf{+.f64}\left(4, \mathsf{*.f64}\left(z, \color{blue}{\left(6 \cdot -1\right)}\right)\right)\right)\right) \]
                    16. metadata-eval99.8%

                      \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(y, x\right), \mathsf{+.f64}\left(4, \mathsf{*.f64}\left(z, -6\right)\right)\right)\right) \]
                  3. Simplified99.8%

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

                    \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(y, x\right), \color{blue}{4}\right)\right) \]
                  6. Step-by-step derivation
                    1. Simplified47.2%

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

                      \[\leadsto \color{blue}{-3 \cdot x} \]
                    3. Step-by-step derivation
                      1. *-commutativeN/A

                        \[\leadsto x \cdot \color{blue}{-3} \]
                      2. *-lowering-*.f6423.0%

                        \[\leadsto \mathsf{*.f64}\left(x, \color{blue}{-3}\right) \]
                    4. Simplified23.0%

                      \[\leadsto \color{blue}{x \cdot -3} \]
                    5. Add Preprocessing

                    Reproduce

                    ?
                    herbie shell --seed 2024155 
                    (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))))