Numeric.Log:$cexpm1 from log-domain-0.10.2.1, B

Percentage Accurate: 100.0% → 100.0%
Time: 3.8s
Alternatives: 8
Speedup: 1.0×

Specification

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

\\
\left(x \cdot y + x\right) + y
\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 8 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: 100.0% accurate, 1.0× speedup?

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

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

Alternative 1: 100.0% accurate, 0.1× speedup?

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

\\
\mathsf{fma}\left(y + 1, x, y\right)
\end{array}
Derivation
  1. Initial program 100.0%

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

      \[\leadsto \left(\color{blue}{y \cdot x} + x\right) + y \]
    2. distribute-lft1-in100.0%

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(y + 1, x, y\right)} \]
  3. Simplified100.0%

    \[\leadsto \color{blue}{\mathsf{fma}\left(y + 1, x, y\right)} \]
  4. Final simplification100.0%

    \[\leadsto \mathsf{fma}\left(y + 1, x, y\right) \]

Alternative 2: 60.4% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -3 \cdot 10^{+230}:\\ \;\;\;\;y \cdot x\\ \mathbf{elif}\;x \leq -9.5 \cdot 10^{+203}:\\ \;\;\;\;x\\ \mathbf{elif}\;x \leq -1.45 \cdot 10^{+179}:\\ \;\;\;\;y \cdot x\\ \mathbf{elif}\;x \leq -4.8 \cdot 10^{+102}:\\ \;\;\;\;x\\ \mathbf{elif}\;x \leq -4.1 \cdot 10^{+27}:\\ \;\;\;\;y \cdot x\\ \mathbf{elif}\;x \leq -4.9 \cdot 10^{-119}:\\ \;\;\;\;x\\ \mathbf{elif}\;x \leq 1:\\ \;\;\;\;y\\ \mathbf{else}:\\ \;\;\;\;y \cdot x\\ \end{array} \end{array} \]
(FPCore (x y)
 :precision binary64
 (if (<= x -3e+230)
   (* y x)
   (if (<= x -9.5e+203)
     x
     (if (<= x -1.45e+179)
       (* y x)
       (if (<= x -4.8e+102)
         x
         (if (<= x -4.1e+27)
           (* y x)
           (if (<= x -4.9e-119) x (if (<= x 1.0) y (* y x)))))))))
double code(double x, double y) {
	double tmp;
	if (x <= -3e+230) {
		tmp = y * x;
	} else if (x <= -9.5e+203) {
		tmp = x;
	} else if (x <= -1.45e+179) {
		tmp = y * x;
	} else if (x <= -4.8e+102) {
		tmp = x;
	} else if (x <= -4.1e+27) {
		tmp = y * x;
	} else if (x <= -4.9e-119) {
		tmp = x;
	} else if (x <= 1.0) {
		tmp = y;
	} else {
		tmp = y * x;
	}
	return tmp;
}
real(8) function code(x, y)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8) :: tmp
    if (x <= (-3d+230)) then
        tmp = y * x
    else if (x <= (-9.5d+203)) then
        tmp = x
    else if (x <= (-1.45d+179)) then
        tmp = y * x
    else if (x <= (-4.8d+102)) then
        tmp = x
    else if (x <= (-4.1d+27)) then
        tmp = y * x
    else if (x <= (-4.9d-119)) then
        tmp = x
    else if (x <= 1.0d0) then
        tmp = y
    else
        tmp = y * x
    end if
    code = tmp
end function
public static double code(double x, double y) {
	double tmp;
	if (x <= -3e+230) {
		tmp = y * x;
	} else if (x <= -9.5e+203) {
		tmp = x;
	} else if (x <= -1.45e+179) {
		tmp = y * x;
	} else if (x <= -4.8e+102) {
		tmp = x;
	} else if (x <= -4.1e+27) {
		tmp = y * x;
	} else if (x <= -4.9e-119) {
		tmp = x;
	} else if (x <= 1.0) {
		tmp = y;
	} else {
		tmp = y * x;
	}
	return tmp;
}
def code(x, y):
	tmp = 0
	if x <= -3e+230:
		tmp = y * x
	elif x <= -9.5e+203:
		tmp = x
	elif x <= -1.45e+179:
		tmp = y * x
	elif x <= -4.8e+102:
		tmp = x
	elif x <= -4.1e+27:
		tmp = y * x
	elif x <= -4.9e-119:
		tmp = x
	elif x <= 1.0:
		tmp = y
	else:
		tmp = y * x
	return tmp
function code(x, y)
	tmp = 0.0
	if (x <= -3e+230)
		tmp = Float64(y * x);
	elseif (x <= -9.5e+203)
		tmp = x;
	elseif (x <= -1.45e+179)
		tmp = Float64(y * x);
	elseif (x <= -4.8e+102)
		tmp = x;
	elseif (x <= -4.1e+27)
		tmp = Float64(y * x);
	elseif (x <= -4.9e-119)
		tmp = x;
	elseif (x <= 1.0)
		tmp = y;
	else
		tmp = Float64(y * x);
	end
	return tmp
end
function tmp_2 = code(x, y)
	tmp = 0.0;
	if (x <= -3e+230)
		tmp = y * x;
	elseif (x <= -9.5e+203)
		tmp = x;
	elseif (x <= -1.45e+179)
		tmp = y * x;
	elseif (x <= -4.8e+102)
		tmp = x;
	elseif (x <= -4.1e+27)
		tmp = y * x;
	elseif (x <= -4.9e-119)
		tmp = x;
	elseif (x <= 1.0)
		tmp = y;
	else
		tmp = y * x;
	end
	tmp_2 = tmp;
end
code[x_, y_] := If[LessEqual[x, -3e+230], N[(y * x), $MachinePrecision], If[LessEqual[x, -9.5e+203], x, If[LessEqual[x, -1.45e+179], N[(y * x), $MachinePrecision], If[LessEqual[x, -4.8e+102], x, If[LessEqual[x, -4.1e+27], N[(y * x), $MachinePrecision], If[LessEqual[x, -4.9e-119], x, If[LessEqual[x, 1.0], y, N[(y * x), $MachinePrecision]]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x \leq -3 \cdot 10^{+230}:\\
\;\;\;\;y \cdot x\\

\mathbf{elif}\;x \leq -9.5 \cdot 10^{+203}:\\
\;\;\;\;x\\

\mathbf{elif}\;x \leq -1.45 \cdot 10^{+179}:\\
\;\;\;\;y \cdot x\\

\mathbf{elif}\;x \leq -4.8 \cdot 10^{+102}:\\
\;\;\;\;x\\

\mathbf{elif}\;x \leq -4.1 \cdot 10^{+27}:\\
\;\;\;\;y \cdot x\\

\mathbf{elif}\;x \leq -4.9 \cdot 10^{-119}:\\
\;\;\;\;x\\

\mathbf{elif}\;x \leq 1:\\
\;\;\;\;y\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -3.00000000000000008e230 or -9.4999999999999995e203 < x < -1.45000000000000009e179 or -4.79999999999999989e102 < x < -4.1000000000000002e27 or 1 < x

    1. Initial program 100.0%

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

        \[\leadsto \left(\color{blue}{y \cdot x} + x\right) + y \]
      2. distribute-lft1-in100.0%

        \[\leadsto \color{blue}{\left(y + 1\right) \cdot x} + y \]
    3. Applied egg-rr100.0%

      \[\leadsto \color{blue}{\left(y + 1\right) \cdot x} + y \]
    4. Step-by-step derivation
      1. +-commutative100.0%

        \[\leadsto \color{blue}{y + \left(y + 1\right) \cdot x} \]
      2. distribute-lft1-in100.0%

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

        \[\leadsto y + \left(\color{blue}{x \cdot y} + x\right) \]
      4. associate-+r+100.0%

        \[\leadsto \color{blue}{\left(y + x \cdot y\right) + x} \]
      5. *-un-lft-identity100.0%

        \[\leadsto \left(\color{blue}{1 \cdot y} + x \cdot y\right) + x \]
      6. distribute-rgt-in100.0%

        \[\leadsto \color{blue}{y \cdot \left(1 + x\right)} + x \]
      7. add-cube-cbrt99.4%

        \[\leadsto \color{blue}{\left(\left(\sqrt[3]{y} \cdot \sqrt[3]{y}\right) \cdot \sqrt[3]{y}\right)} \cdot \left(1 + x\right) + x \]
      8. unpow299.4%

        \[\leadsto \left(\color{blue}{{\left(\sqrt[3]{y}\right)}^{2}} \cdot \sqrt[3]{y}\right) \cdot \left(1 + x\right) + x \]
      9. associate-*l*99.4%

        \[\leadsto \color{blue}{{\left(\sqrt[3]{y}\right)}^{2} \cdot \left(\sqrt[3]{y} \cdot \left(1 + x\right)\right)} + x \]
      10. fma-def99.4%

        \[\leadsto \color{blue}{\mathsf{fma}\left({\left(\sqrt[3]{y}\right)}^{2}, \sqrt[3]{y} \cdot \left(1 + x\right), x\right)} \]
    5. Applied egg-rr99.4%

      \[\leadsto \color{blue}{\mathsf{fma}\left({\left(\sqrt[3]{y}\right)}^{2}, \sqrt[3]{y} \cdot \left(1 + x\right), x\right)} \]
    6. Taylor expanded in x around inf 99.2%

      \[\leadsto \color{blue}{x \cdot \left(1 + {1}^{0.3333333333333333} \cdot y\right)} \]
    7. Step-by-step derivation
      1. pow-base-199.2%

        \[\leadsto x \cdot \left(1 + \color{blue}{1} \cdot y\right) \]
      2. *-lft-identity99.2%

        \[\leadsto x \cdot \left(1 + \color{blue}{y}\right) \]
    8. Simplified99.2%

      \[\leadsto \color{blue}{x \cdot \left(1 + y\right)} \]
    9. Taylor expanded in y around inf 58.0%

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

    if -3.00000000000000008e230 < x < -9.4999999999999995e203 or -1.45000000000000009e179 < x < -4.79999999999999989e102 or -4.1000000000000002e27 < x < -4.9e-119

    1. Initial program 100.0%

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

        \[\leadsto \left(\color{blue}{y \cdot x} + x\right) + y \]
      2. distribute-lft1-in100.0%

        \[\leadsto \color{blue}{\left(y + 1\right) \cdot x} + y \]
    3. Applied egg-rr100.0%

      \[\leadsto \color{blue}{\left(y + 1\right) \cdot x} + y \]
    4. Step-by-step derivation
      1. +-commutative100.0%

        \[\leadsto \color{blue}{y + \left(y + 1\right) \cdot x} \]
      2. distribute-lft1-in100.0%

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

        \[\leadsto y + \left(\color{blue}{x \cdot y} + x\right) \]
      4. associate-+r+100.0%

        \[\leadsto \color{blue}{\left(y + x \cdot y\right) + x} \]
      5. *-un-lft-identity100.0%

        \[\leadsto \left(\color{blue}{1 \cdot y} + x \cdot y\right) + x \]
      6. distribute-rgt-in100.0%

        \[\leadsto \color{blue}{y \cdot \left(1 + x\right)} + x \]
      7. add-cube-cbrt99.4%

        \[\leadsto \color{blue}{\left(\left(\sqrt[3]{y} \cdot \sqrt[3]{y}\right) \cdot \sqrt[3]{y}\right)} \cdot \left(1 + x\right) + x \]
      8. unpow299.4%

        \[\leadsto \left(\color{blue}{{\left(\sqrt[3]{y}\right)}^{2}} \cdot \sqrt[3]{y}\right) \cdot \left(1 + x\right) + x \]
      9. associate-*l*99.3%

        \[\leadsto \color{blue}{{\left(\sqrt[3]{y}\right)}^{2} \cdot \left(\sqrt[3]{y} \cdot \left(1 + x\right)\right)} + x \]
      10. fma-def99.3%

        \[\leadsto \color{blue}{\mathsf{fma}\left({\left(\sqrt[3]{y}\right)}^{2}, \sqrt[3]{y} \cdot \left(1 + x\right), x\right)} \]
    5. Applied egg-rr99.3%

      \[\leadsto \color{blue}{\mathsf{fma}\left({\left(\sqrt[3]{y}\right)}^{2}, \sqrt[3]{y} \cdot \left(1 + x\right), x\right)} \]
    6. Taylor expanded in y around 0 61.1%

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

    if -4.9e-119 < x < 1

    1. Initial program 100.0%

      \[\left(x \cdot y + x\right) + y \]
    2. Taylor expanded in x around 0 73.4%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -3 \cdot 10^{+230}:\\ \;\;\;\;y \cdot x\\ \mathbf{elif}\;x \leq -9.5 \cdot 10^{+203}:\\ \;\;\;\;x\\ \mathbf{elif}\;x \leq -1.45 \cdot 10^{+179}:\\ \;\;\;\;y \cdot x\\ \mathbf{elif}\;x \leq -4.8 \cdot 10^{+102}:\\ \;\;\;\;x\\ \mathbf{elif}\;x \leq -4.1 \cdot 10^{+27}:\\ \;\;\;\;y \cdot x\\ \mathbf{elif}\;x \leq -4.9 \cdot 10^{-119}:\\ \;\;\;\;x\\ \mathbf{elif}\;x \leq 1:\\ \;\;\;\;y\\ \mathbf{else}:\\ \;\;\;\;y \cdot x\\ \end{array} \]

Alternative 3: 74.8% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -1500000 \lor \neg \left(y \leq 1.8 \cdot 10^{+121}\right) \land \left(y \leq 5 \cdot 10^{+177} \lor \neg \left(y \leq 1.05 \cdot 10^{+281}\right)\right):\\ \;\;\;\;y \cdot x\\ \mathbf{else}:\\ \;\;\;\;y + x\\ \end{array} \end{array} \]
(FPCore (x y)
 :precision binary64
 (if (or (<= y -1500000.0)
         (and (not (<= y 1.8e+121)) (or (<= y 5e+177) (not (<= y 1.05e+281)))))
   (* y x)
   (+ y x)))
double code(double x, double y) {
	double tmp;
	if ((y <= -1500000.0) || (!(y <= 1.8e+121) && ((y <= 5e+177) || !(y <= 1.05e+281)))) {
		tmp = y * x;
	} else {
		tmp = y + x;
	}
	return tmp;
}
real(8) function code(x, y)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8) :: tmp
    if ((y <= (-1500000.0d0)) .or. (.not. (y <= 1.8d+121)) .and. (y <= 5d+177) .or. (.not. (y <= 1.05d+281))) then
        tmp = y * x
    else
        tmp = y + x
    end if
    code = tmp
end function
public static double code(double x, double y) {
	double tmp;
	if ((y <= -1500000.0) || (!(y <= 1.8e+121) && ((y <= 5e+177) || !(y <= 1.05e+281)))) {
		tmp = y * x;
	} else {
		tmp = y + x;
	}
	return tmp;
}
def code(x, y):
	tmp = 0
	if (y <= -1500000.0) or (not (y <= 1.8e+121) and ((y <= 5e+177) or not (y <= 1.05e+281))):
		tmp = y * x
	else:
		tmp = y + x
	return tmp
function code(x, y)
	tmp = 0.0
	if ((y <= -1500000.0) || (!(y <= 1.8e+121) && ((y <= 5e+177) || !(y <= 1.05e+281))))
		tmp = Float64(y * x);
	else
		tmp = Float64(y + x);
	end
	return tmp
end
function tmp_2 = code(x, y)
	tmp = 0.0;
	if ((y <= -1500000.0) || (~((y <= 1.8e+121)) && ((y <= 5e+177) || ~((y <= 1.05e+281)))))
		tmp = y * x;
	else
		tmp = y + x;
	end
	tmp_2 = tmp;
end
code[x_, y_] := If[Or[LessEqual[y, -1500000.0], And[N[Not[LessEqual[y, 1.8e+121]], $MachinePrecision], Or[LessEqual[y, 5e+177], N[Not[LessEqual[y, 1.05e+281]], $MachinePrecision]]]], N[(y * x), $MachinePrecision], N[(y + x), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;y \leq -1500000 \lor \neg \left(y \leq 1.8 \cdot 10^{+121}\right) \land \left(y \leq 5 \cdot 10^{+177} \lor \neg \left(y \leq 1.05 \cdot 10^{+281}\right)\right):\\
\;\;\;\;y \cdot x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -1.5e6 or 1.79999999999999991e121 < y < 5.0000000000000003e177 or 1.05000000000000003e281 < y

    1. Initial program 100.0%

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

        \[\leadsto \left(\color{blue}{y \cdot x} + x\right) + y \]
      2. distribute-lft1-in100.0%

        \[\leadsto \color{blue}{\left(y + 1\right) \cdot x} + y \]
    3. Applied egg-rr100.0%

      \[\leadsto \color{blue}{\left(y + 1\right) \cdot x} + y \]
    4. Step-by-step derivation
      1. +-commutative100.0%

        \[\leadsto \color{blue}{y + \left(y + 1\right) \cdot x} \]
      2. distribute-lft1-in100.0%

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

        \[\leadsto y + \left(\color{blue}{x \cdot y} + x\right) \]
      4. associate-+r+100.0%

        \[\leadsto \color{blue}{\left(y + x \cdot y\right) + x} \]
      5. *-un-lft-identity100.0%

        \[\leadsto \left(\color{blue}{1 \cdot y} + x \cdot y\right) + x \]
      6. distribute-rgt-in100.0%

        \[\leadsto \color{blue}{y \cdot \left(1 + x\right)} + x \]
      7. add-cube-cbrt98.7%

        \[\leadsto \color{blue}{\left(\left(\sqrt[3]{y} \cdot \sqrt[3]{y}\right) \cdot \sqrt[3]{y}\right)} \cdot \left(1 + x\right) + x \]
      8. unpow298.7%

        \[\leadsto \left(\color{blue}{{\left(\sqrt[3]{y}\right)}^{2}} \cdot \sqrt[3]{y}\right) \cdot \left(1 + x\right) + x \]
      9. associate-*l*98.6%

        \[\leadsto \color{blue}{{\left(\sqrt[3]{y}\right)}^{2} \cdot \left(\sqrt[3]{y} \cdot \left(1 + x\right)\right)} + x \]
      10. fma-def98.6%

        \[\leadsto \color{blue}{\mathsf{fma}\left({\left(\sqrt[3]{y}\right)}^{2}, \sqrt[3]{y} \cdot \left(1 + x\right), x\right)} \]
    5. Applied egg-rr98.6%

      \[\leadsto \color{blue}{\mathsf{fma}\left({\left(\sqrt[3]{y}\right)}^{2}, \sqrt[3]{y} \cdot \left(1 + x\right), x\right)} \]
    6. Taylor expanded in x around inf 58.0%

      \[\leadsto \color{blue}{x \cdot \left(1 + {1}^{0.3333333333333333} \cdot y\right)} \]
    7. Step-by-step derivation
      1. pow-base-158.0%

        \[\leadsto x \cdot \left(1 + \color{blue}{1} \cdot y\right) \]
      2. *-lft-identity58.0%

        \[\leadsto x \cdot \left(1 + \color{blue}{y}\right) \]
    8. Simplified58.0%

      \[\leadsto \color{blue}{x \cdot \left(1 + y\right)} \]
    9. Taylor expanded in y around inf 57.6%

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

    if -1.5e6 < y < 1.79999999999999991e121 or 5.0000000000000003e177 < y < 1.05000000000000003e281

    1. Initial program 100.0%

      \[\left(x \cdot y + x\right) + y \]
    2. Taylor expanded in y around 0 88.1%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1500000 \lor \neg \left(y \leq 1.8 \cdot 10^{+121}\right) \land \left(y \leq 5 \cdot 10^{+177} \lor \neg \left(y \leq 1.05 \cdot 10^{+281}\right)\right):\\ \;\;\;\;y \cdot x\\ \mathbf{else}:\\ \;\;\;\;y + x\\ \end{array} \]

Alternative 4: 87.0% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -2.6 \cdot 10^{-7}:\\ \;\;\;\;\left(y + 1\right) \cdot x\\ \mathbf{elif}\;y \leq 0.55:\\ \;\;\;\;y + x\\ \mathbf{else}:\\ \;\;\;\;y \cdot \left(1 + x\right)\\ \end{array} \end{array} \]
(FPCore (x y)
 :precision binary64
 (if (<= y -2.6e-7) (* (+ y 1.0) x) (if (<= y 0.55) (+ y x) (* y (+ 1.0 x)))))
double code(double x, double y) {
	double tmp;
	if (y <= -2.6e-7) {
		tmp = (y + 1.0) * x;
	} else if (y <= 0.55) {
		tmp = y + x;
	} else {
		tmp = y * (1.0 + x);
	}
	return tmp;
}
real(8) function code(x, y)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8) :: tmp
    if (y <= (-2.6d-7)) then
        tmp = (y + 1.0d0) * x
    else if (y <= 0.55d0) then
        tmp = y + x
    else
        tmp = y * (1.0d0 + x)
    end if
    code = tmp
end function
public static double code(double x, double y) {
	double tmp;
	if (y <= -2.6e-7) {
		tmp = (y + 1.0) * x;
	} else if (y <= 0.55) {
		tmp = y + x;
	} else {
		tmp = y * (1.0 + x);
	}
	return tmp;
}
def code(x, y):
	tmp = 0
	if y <= -2.6e-7:
		tmp = (y + 1.0) * x
	elif y <= 0.55:
		tmp = y + x
	else:
		tmp = y * (1.0 + x)
	return tmp
function code(x, y)
	tmp = 0.0
	if (y <= -2.6e-7)
		tmp = Float64(Float64(y + 1.0) * x);
	elseif (y <= 0.55)
		tmp = Float64(y + x);
	else
		tmp = Float64(y * Float64(1.0 + x));
	end
	return tmp
end
function tmp_2 = code(x, y)
	tmp = 0.0;
	if (y <= -2.6e-7)
		tmp = (y + 1.0) * x;
	elseif (y <= 0.55)
		tmp = y + x;
	else
		tmp = y * (1.0 + x);
	end
	tmp_2 = tmp;
end
code[x_, y_] := If[LessEqual[y, -2.6e-7], N[(N[(y + 1.0), $MachinePrecision] * x), $MachinePrecision], If[LessEqual[y, 0.55], N[(y + x), $MachinePrecision], N[(y * N[(1.0 + x), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.6 \cdot 10^{-7}:\\
\;\;\;\;\left(y + 1\right) \cdot x\\

\mathbf{elif}\;y \leq 0.55:\\
\;\;\;\;y + x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -2.59999999999999999e-7

    1. Initial program 100.0%

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

        \[\leadsto \left(\color{blue}{y \cdot x} + x\right) + y \]
      2. distribute-lft1-in100.0%

        \[\leadsto \color{blue}{\left(y + 1\right) \cdot x} + y \]
    3. Applied egg-rr100.0%

      \[\leadsto \color{blue}{\left(y + 1\right) \cdot x} + y \]
    4. Step-by-step derivation
      1. +-commutative100.0%

        \[\leadsto \color{blue}{y + \left(y + 1\right) \cdot x} \]
      2. distribute-lft1-in100.0%

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

        \[\leadsto y + \left(\color{blue}{x \cdot y} + x\right) \]
      4. associate-+r+100.0%

        \[\leadsto \color{blue}{\left(y + x \cdot y\right) + x} \]
      5. *-un-lft-identity100.0%

        \[\leadsto \left(\color{blue}{1 \cdot y} + x \cdot y\right) + x \]
      6. distribute-rgt-in100.0%

        \[\leadsto \color{blue}{y \cdot \left(1 + x\right)} + x \]
      7. add-cube-cbrt98.7%

        \[\leadsto \color{blue}{\left(\left(\sqrt[3]{y} \cdot \sqrt[3]{y}\right) \cdot \sqrt[3]{y}\right)} \cdot \left(1 + x\right) + x \]
      8. unpow298.7%

        \[\leadsto \left(\color{blue}{{\left(\sqrt[3]{y}\right)}^{2}} \cdot \sqrt[3]{y}\right) \cdot \left(1 + x\right) + x \]
      9. associate-*l*98.6%

        \[\leadsto \color{blue}{{\left(\sqrt[3]{y}\right)}^{2} \cdot \left(\sqrt[3]{y} \cdot \left(1 + x\right)\right)} + x \]
      10. fma-def98.6%

        \[\leadsto \color{blue}{\mathsf{fma}\left({\left(\sqrt[3]{y}\right)}^{2}, \sqrt[3]{y} \cdot \left(1 + x\right), x\right)} \]
    5. Applied egg-rr98.6%

      \[\leadsto \color{blue}{\mathsf{fma}\left({\left(\sqrt[3]{y}\right)}^{2}, \sqrt[3]{y} \cdot \left(1 + x\right), x\right)} \]
    6. Taylor expanded in x around inf 53.9%

      \[\leadsto \color{blue}{x \cdot \left(1 + {1}^{0.3333333333333333} \cdot y\right)} \]
    7. Step-by-step derivation
      1. pow-base-153.9%

        \[\leadsto x \cdot \left(1 + \color{blue}{1} \cdot y\right) \]
      2. *-lft-identity53.9%

        \[\leadsto x \cdot \left(1 + \color{blue}{y}\right) \]
    8. Simplified53.9%

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

    if -2.59999999999999999e-7 < y < 0.55000000000000004

    1. Initial program 100.0%

      \[\left(x \cdot y + x\right) + y \]
    2. Taylor expanded in y around 0 99.9%

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

    if 0.55000000000000004 < y

    1. Initial program 100.0%

      \[\left(x \cdot y + x\right) + y \]
    2. Taylor expanded in y around inf 100.0%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -2.6 \cdot 10^{-7}:\\ \;\;\;\;\left(y + 1\right) \cdot x\\ \mathbf{elif}\;y \leq 0.55:\\ \;\;\;\;y + x\\ \mathbf{else}:\\ \;\;\;\;y \cdot \left(1 + x\right)\\ \end{array} \]

Alternative 5: 86.3% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -160000000:\\
\;\;\;\;\left(y + 1\right) \cdot x\\

\mathbf{elif}\;x \leq 650000:\\
\;\;\;\;y + x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -1.6e8

    1. Initial program 100.0%

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

        \[\leadsto \left(\color{blue}{y \cdot x} + x\right) + y \]
      2. distribute-lft1-in100.0%

        \[\leadsto \color{blue}{\left(y + 1\right) \cdot x} + y \]
    3. Applied egg-rr100.0%

      \[\leadsto \color{blue}{\left(y + 1\right) \cdot x} + y \]
    4. Step-by-step derivation
      1. +-commutative100.0%

        \[\leadsto \color{blue}{y + \left(y + 1\right) \cdot x} \]
      2. distribute-lft1-in100.0%

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

        \[\leadsto y + \left(\color{blue}{x \cdot y} + x\right) \]
      4. associate-+r+100.0%

        \[\leadsto \color{blue}{\left(y + x \cdot y\right) + x} \]
      5. *-un-lft-identity100.0%

        \[\leadsto \left(\color{blue}{1 \cdot y} + x \cdot y\right) + x \]
      6. distribute-rgt-in100.0%

        \[\leadsto \color{blue}{y \cdot \left(1 + x\right)} + x \]
      7. add-cube-cbrt99.4%

        \[\leadsto \color{blue}{\left(\left(\sqrt[3]{y} \cdot \sqrt[3]{y}\right) \cdot \sqrt[3]{y}\right)} \cdot \left(1 + x\right) + x \]
      8. unpow299.4%

        \[\leadsto \left(\color{blue}{{\left(\sqrt[3]{y}\right)}^{2}} \cdot \sqrt[3]{y}\right) \cdot \left(1 + x\right) + x \]
      9. associate-*l*99.3%

        \[\leadsto \color{blue}{{\left(\sqrt[3]{y}\right)}^{2} \cdot \left(\sqrt[3]{y} \cdot \left(1 + x\right)\right)} + x \]
      10. fma-def99.3%

        \[\leadsto \color{blue}{\mathsf{fma}\left({\left(\sqrt[3]{y}\right)}^{2}, \sqrt[3]{y} \cdot \left(1 + x\right), x\right)} \]
    5. Applied egg-rr99.3%

      \[\leadsto \color{blue}{\mathsf{fma}\left({\left(\sqrt[3]{y}\right)}^{2}, \sqrt[3]{y} \cdot \left(1 + x\right), x\right)} \]
    6. Taylor expanded in x around inf 99.6%

      \[\leadsto \color{blue}{x \cdot \left(1 + {1}^{0.3333333333333333} \cdot y\right)} \]
    7. Step-by-step derivation
      1. pow-base-199.6%

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

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

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

    if -1.6e8 < x < 6.5e5

    1. Initial program 100.0%

      \[\left(x \cdot y + x\right) + y \]
    2. Taylor expanded in y around 0 96.8%

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

    if 6.5e5 < x

    1. Initial program 100.0%

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

        \[\leadsto \left(\color{blue}{y \cdot x} + x\right) + y \]
      2. distribute-lft1-in100.0%

        \[\leadsto \color{blue}{\left(y + 1\right) \cdot x} + y \]
    3. Applied egg-rr100.0%

      \[\leadsto \color{blue}{\left(y + 1\right) \cdot x} + y \]
    4. Step-by-step derivation
      1. +-commutative100.0%

        \[\leadsto \color{blue}{y + \left(y + 1\right) \cdot x} \]
      2. distribute-lft1-in100.0%

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

        \[\leadsto y + \left(\color{blue}{x \cdot y} + x\right) \]
      4. associate-+r+100.0%

        \[\leadsto \color{blue}{\left(y + x \cdot y\right) + x} \]
      5. *-un-lft-identity100.0%

        \[\leadsto \left(\color{blue}{1 \cdot y} + x \cdot y\right) + x \]
      6. distribute-rgt-in100.0%

        \[\leadsto \color{blue}{y \cdot \left(1 + x\right)} + x \]
      7. add-cube-cbrt99.5%

        \[\leadsto \color{blue}{\left(\left(\sqrt[3]{y} \cdot \sqrt[3]{y}\right) \cdot \sqrt[3]{y}\right)} \cdot \left(1 + x\right) + x \]
      8. unpow299.5%

        \[\leadsto \left(\color{blue}{{\left(\sqrt[3]{y}\right)}^{2}} \cdot \sqrt[3]{y}\right) \cdot \left(1 + x\right) + x \]
      9. associate-*l*99.6%

        \[\leadsto \color{blue}{{\left(\sqrt[3]{y}\right)}^{2} \cdot \left(\sqrt[3]{y} \cdot \left(1 + x\right)\right)} + x \]
      10. fma-def99.6%

        \[\leadsto \color{blue}{\mathsf{fma}\left({\left(\sqrt[3]{y}\right)}^{2}, \sqrt[3]{y} \cdot \left(1 + x\right), x\right)} \]
    5. Applied egg-rr99.6%

      \[\leadsto \color{blue}{\mathsf{fma}\left({\left(\sqrt[3]{y}\right)}^{2}, \sqrt[3]{y} \cdot \left(1 + x\right), x\right)} \]
    6. Taylor expanded in x around inf 98.7%

      \[\leadsto \color{blue}{x \cdot \left(1 + {1}^{0.3333333333333333} \cdot y\right)} \]
    7. Step-by-step derivation
      1. pow-base-198.7%

        \[\leadsto x \cdot \left(1 + \color{blue}{1} \cdot y\right) \]
      2. *-lft-identity98.7%

        \[\leadsto x \cdot \left(1 + \color{blue}{y}\right) \]
    8. Simplified98.7%

      \[\leadsto \color{blue}{x \cdot \left(1 + y\right)} \]
    9. Taylor expanded in y around inf 53.0%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -160000000:\\ \;\;\;\;\left(y + 1\right) \cdot x\\ \mathbf{elif}\;x \leq 650000:\\ \;\;\;\;y + x\\ \mathbf{else}:\\ \;\;\;\;y \cdot x\\ \end{array} \]

Alternative 6: 100.0% accurate, 1.0× speedup?

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

\\
y + \left(y + 1\right) \cdot x
\end{array}
Derivation
  1. Initial program 100.0%

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

      \[\leadsto \left(\color{blue}{y \cdot x} + x\right) + y \]
    2. distribute-lft1-in100.0%

      \[\leadsto \color{blue}{\left(y + 1\right) \cdot x} + y \]
  3. Applied egg-rr100.0%

    \[\leadsto \color{blue}{\left(y + 1\right) \cdot x} + y \]
  4. Final simplification100.0%

    \[\leadsto y + \left(y + 1\right) \cdot x \]

Alternative 7: 48.5% accurate, 2.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -4.9 \cdot 10^{-119}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;y\\ \end{array} \end{array} \]
(FPCore (x y) :precision binary64 (if (<= x -4.9e-119) x y))
double code(double x, double y) {
	double tmp;
	if (x <= -4.9e-119) {
		tmp = x;
	} else {
		tmp = y;
	}
	return tmp;
}
real(8) function code(x, y)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8) :: tmp
    if (x <= (-4.9d-119)) then
        tmp = x
    else
        tmp = y
    end if
    code = tmp
end function
public static double code(double x, double y) {
	double tmp;
	if (x <= -4.9e-119) {
		tmp = x;
	} else {
		tmp = y;
	}
	return tmp;
}
def code(x, y):
	tmp = 0
	if x <= -4.9e-119:
		tmp = x
	else:
		tmp = y
	return tmp
function code(x, y)
	tmp = 0.0
	if (x <= -4.9e-119)
		tmp = x;
	else
		tmp = y;
	end
	return tmp
end
function tmp_2 = code(x, y)
	tmp = 0.0;
	if (x <= -4.9e-119)
		tmp = x;
	else
		tmp = y;
	end
	tmp_2 = tmp;
end
code[x_, y_] := If[LessEqual[x, -4.9e-119], x, y]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x \leq -4.9 \cdot 10^{-119}:\\
\;\;\;\;x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -4.9e-119

    1. Initial program 100.0%

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

        \[\leadsto \left(\color{blue}{y \cdot x} + x\right) + y \]
      2. distribute-lft1-in100.0%

        \[\leadsto \color{blue}{\left(y + 1\right) \cdot x} + y \]
    3. Applied egg-rr100.0%

      \[\leadsto \color{blue}{\left(y + 1\right) \cdot x} + y \]
    4. Step-by-step derivation
      1. +-commutative100.0%

        \[\leadsto \color{blue}{y + \left(y + 1\right) \cdot x} \]
      2. distribute-lft1-in100.0%

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

        \[\leadsto y + \left(\color{blue}{x \cdot y} + x\right) \]
      4. associate-+r+100.0%

        \[\leadsto \color{blue}{\left(y + x \cdot y\right) + x} \]
      5. *-un-lft-identity100.0%

        \[\leadsto \left(\color{blue}{1 \cdot y} + x \cdot y\right) + x \]
      6. distribute-rgt-in100.0%

        \[\leadsto \color{blue}{y \cdot \left(1 + x\right)} + x \]
      7. add-cube-cbrt99.3%

        \[\leadsto \color{blue}{\left(\left(\sqrt[3]{y} \cdot \sqrt[3]{y}\right) \cdot \sqrt[3]{y}\right)} \cdot \left(1 + x\right) + x \]
      8. unpow299.3%

        \[\leadsto \left(\color{blue}{{\left(\sqrt[3]{y}\right)}^{2}} \cdot \sqrt[3]{y}\right) \cdot \left(1 + x\right) + x \]
      9. associate-*l*99.3%

        \[\leadsto \color{blue}{{\left(\sqrt[3]{y}\right)}^{2} \cdot \left(\sqrt[3]{y} \cdot \left(1 + x\right)\right)} + x \]
      10. fma-def99.3%

        \[\leadsto \color{blue}{\mathsf{fma}\left({\left(\sqrt[3]{y}\right)}^{2}, \sqrt[3]{y} \cdot \left(1 + x\right), x\right)} \]
    5. Applied egg-rr99.3%

      \[\leadsto \color{blue}{\mathsf{fma}\left({\left(\sqrt[3]{y}\right)}^{2}, \sqrt[3]{y} \cdot \left(1 + x\right), x\right)} \]
    6. Taylor expanded in y around 0 49.4%

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

    if -4.9e-119 < x

    1. Initial program 100.0%

      \[\left(x \cdot y + x\right) + y \]
    2. Taylor expanded in x around 0 46.7%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -4.9 \cdot 10^{-119}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;y\\ \end{array} \]

Alternative 8: 37.8% accurate, 7.0× speedup?

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

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

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

      \[\leadsto \left(\color{blue}{y \cdot x} + x\right) + y \]
    2. distribute-lft1-in100.0%

      \[\leadsto \color{blue}{\left(y + 1\right) \cdot x} + y \]
  3. Applied egg-rr100.0%

    \[\leadsto \color{blue}{\left(y + 1\right) \cdot x} + y \]
  4. Step-by-step derivation
    1. +-commutative100.0%

      \[\leadsto \color{blue}{y + \left(y + 1\right) \cdot x} \]
    2. distribute-lft1-in100.0%

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

      \[\leadsto y + \left(\color{blue}{x \cdot y} + x\right) \]
    4. associate-+r+100.0%

      \[\leadsto \color{blue}{\left(y + x \cdot y\right) + x} \]
    5. *-un-lft-identity100.0%

      \[\leadsto \left(\color{blue}{1 \cdot y} + x \cdot y\right) + x \]
    6. distribute-rgt-in100.0%

      \[\leadsto \color{blue}{y \cdot \left(1 + x\right)} + x \]
    7. add-cube-cbrt99.0%

      \[\leadsto \color{blue}{\left(\left(\sqrt[3]{y} \cdot \sqrt[3]{y}\right) \cdot \sqrt[3]{y}\right)} \cdot \left(1 + x\right) + x \]
    8. unpow299.0%

      \[\leadsto \left(\color{blue}{{\left(\sqrt[3]{y}\right)}^{2}} \cdot \sqrt[3]{y}\right) \cdot \left(1 + x\right) + x \]
    9. associate-*l*99.0%

      \[\leadsto \color{blue}{{\left(\sqrt[3]{y}\right)}^{2} \cdot \left(\sqrt[3]{y} \cdot \left(1 + x\right)\right)} + x \]
    10. fma-def99.0%

      \[\leadsto \color{blue}{\mathsf{fma}\left({\left(\sqrt[3]{y}\right)}^{2}, \sqrt[3]{y} \cdot \left(1 + x\right), x\right)} \]
  5. Applied egg-rr99.0%

    \[\leadsto \color{blue}{\mathsf{fma}\left({\left(\sqrt[3]{y}\right)}^{2}, \sqrt[3]{y} \cdot \left(1 + x\right), x\right)} \]
  6. Taylor expanded in y around 0 40.5%

    \[\leadsto \color{blue}{x} \]
  7. Final simplification40.5%

    \[\leadsto x \]

Reproduce

?
herbie shell --seed 2023337 
(FPCore (x y)
  :name "Numeric.Log:$cexpm1 from log-domain-0.10.2.1, B"
  :precision binary64
  (+ (+ (* x y) x) y))