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

Percentage Accurate: 100.0% → 100.0%
Time: 7.3s
Alternatives: 7
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 7 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, 1.0× speedup?

\[\begin{array}{l} [x, y] = \mathsf{sort}([x, y])\\ \\ x + y \cdot \left(x + 1\right) \end{array} \]
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y) :precision binary64 (+ x (* y (+ x 1.0))))
assert(x < y);
double code(double x, double y) {
	return x + (y * (x + 1.0));
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    code = x + (y * (x + 1.0d0))
end function
assert x < y;
public static double code(double x, double y) {
	return x + (y * (x + 1.0));
}
[x, y] = sort([x, y])
def code(x, y):
	return x + (y * (x + 1.0))
x, y = sort([x, y])
function code(x, y)
	return Float64(x + Float64(y * Float64(x + 1.0)))
end
x, y = num2cell(sort([x, y])){:}
function tmp = code(x, y)
	tmp = x + (y * (x + 1.0));
end
NOTE: x and y should be sorted in increasing order before calling this function.
code[x_, y_] := N[(x + N[(y * N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
x + y \cdot \left(x + 1\right)
\end{array}
Derivation
  1. Initial program 100.0%

    \[\left(x \cdot y + x\right) + y \]
  2. Step-by-step derivation
    1. associate-+l+N/A

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

      \[\leadsto \left(x + y\right) + \color{blue}{x \cdot y} \]
    3. associate-+l+N/A

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

      \[\leadsto \mathsf{+.f64}\left(x, \color{blue}{\left(y + x \cdot y\right)}\right) \]
    5. distribute-rgt1-inN/A

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

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

      \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(y, \color{blue}{\left(x + 1\right)}\right)\right) \]
    8. +-lowering-+.f64100.0%

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

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

Alternative 2: 99.2% accurate, 0.5× speedup?

\[\begin{array}{l} [x, y] = \mathsf{sort}([x, y])\\ \\ \begin{array}{l} \mathbf{if}\;y \leq -4.5 \cdot 10^{-12}:\\ \;\;\;\;x + x \cdot y\\ \mathbf{elif}\;y \leq 0.0065:\\ \;\;\;\;x + y\\ \mathbf{else}:\\ \;\;\;\;y \cdot \left(x + 1\right)\\ \end{array} \end{array} \]
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y)
 :precision binary64
 (if (<= y -4.5e-12) (+ x (* x y)) (if (<= y 0.0065) (+ x y) (* y (+ x 1.0)))))
assert(x < y);
double code(double x, double y) {
	double tmp;
	if (y <= -4.5e-12) {
		tmp = x + (x * y);
	} else if (y <= 0.0065) {
		tmp = x + y;
	} else {
		tmp = y * (x + 1.0);
	}
	return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8) :: tmp
    if (y <= (-4.5d-12)) then
        tmp = x + (x * y)
    else if (y <= 0.0065d0) then
        tmp = x + y
    else
        tmp = y * (x + 1.0d0)
    end if
    code = tmp
end function
assert x < y;
public static double code(double x, double y) {
	double tmp;
	if (y <= -4.5e-12) {
		tmp = x + (x * y);
	} else if (y <= 0.0065) {
		tmp = x + y;
	} else {
		tmp = y * (x + 1.0);
	}
	return tmp;
}
[x, y] = sort([x, y])
def code(x, y):
	tmp = 0
	if y <= -4.5e-12:
		tmp = x + (x * y)
	elif y <= 0.0065:
		tmp = x + y
	else:
		tmp = y * (x + 1.0)
	return tmp
x, y = sort([x, y])
function code(x, y)
	tmp = 0.0
	if (y <= -4.5e-12)
		tmp = Float64(x + Float64(x * y));
	elseif (y <= 0.0065)
		tmp = Float64(x + y);
	else
		tmp = Float64(y * Float64(x + 1.0));
	end
	return tmp
end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
	tmp = 0.0;
	if (y <= -4.5e-12)
		tmp = x + (x * y);
	elseif (y <= 0.0065)
		tmp = x + y;
	else
		tmp = y * (x + 1.0);
	end
	tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function.
code[x_, y_] := If[LessEqual[y, -4.5e-12], N[(x + N[(x * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 0.0065], N[(x + y), $MachinePrecision], N[(y * N[(x + 1.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq -4.5 \cdot 10^{-12}:\\
\;\;\;\;x + x \cdot y\\

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

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


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

    1. Initial program 100.0%

      \[\left(x \cdot y + x\right) + y \]
    2. Step-by-step derivation
      1. associate-+l+N/A

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

        \[\leadsto \left(x + y\right) + \color{blue}{x \cdot y} \]
      3. associate-+l+N/A

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

        \[\leadsto \mathsf{+.f64}\left(x, \color{blue}{\left(y + x \cdot y\right)}\right) \]
      5. distribute-rgt1-inN/A

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

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

        \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(y, \color{blue}{\left(x + 1\right)}\right)\right) \]
      8. +-lowering-+.f64100.0%

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

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

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

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

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

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

    if -4.49999999999999981e-12 < y < 0.0064999999999999997

    1. Initial program 100.0%

      \[\left(x \cdot y + x\right) + y \]
    2. Step-by-step derivation
      1. associate-+l+N/A

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

        \[\leadsto \left(x + y\right) + \color{blue}{x \cdot y} \]
      3. associate-+l+N/A

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

        \[\leadsto \mathsf{+.f64}\left(x, \color{blue}{\left(y + x \cdot y\right)}\right) \]
      5. distribute-rgt1-inN/A

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

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

        \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(y, \color{blue}{\left(x + 1\right)}\right)\right) \]
      8. +-lowering-+.f64100.0%

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

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

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

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

      if 0.0064999999999999997 < y

      1. Initial program 99.9%

        \[\left(x \cdot y + x\right) + y \]
      2. Step-by-step derivation
        1. associate-+l+N/A

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

          \[\leadsto \left(x + y\right) + \color{blue}{x \cdot y} \]
        3. associate-+l+N/A

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

          \[\leadsto \mathsf{+.f64}\left(x, \color{blue}{\left(y + x \cdot y\right)}\right) \]
        5. distribute-rgt1-inN/A

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

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

          \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(y, \color{blue}{\left(x + 1\right)}\right)\right) \]
        8. +-lowering-+.f64100.0%

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

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

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

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

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

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

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

      \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -4.5 \cdot 10^{-12}:\\ \;\;\;\;x + x \cdot y\\ \mathbf{elif}\;y \leq 0.0065:\\ \;\;\;\;x + y\\ \mathbf{else}:\\ \;\;\;\;y \cdot \left(x + 1\right)\\ \end{array} \]
    9. Add Preprocessing

    Alternative 3: 98.7% accurate, 0.5× speedup?

    \[\begin{array}{l} [x, y] = \mathsf{sort}([x, y])\\ \\ \begin{array}{l} t_0 := y \cdot \left(x + 1\right)\\ \mathbf{if}\;y \leq -1:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;y \leq 0.0065:\\ \;\;\;\;x + y\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
    NOTE: x and y should be sorted in increasing order before calling this function.
    (FPCore (x y)
     :precision binary64
     (let* ((t_0 (* y (+ x 1.0))))
       (if (<= y -1.0) t_0 (if (<= y 0.0065) (+ x y) t_0))))
    assert(x < y);
    double code(double x, double y) {
    	double t_0 = y * (x + 1.0);
    	double tmp;
    	if (y <= -1.0) {
    		tmp = t_0;
    	} else if (y <= 0.0065) {
    		tmp = x + y;
    	} else {
    		tmp = t_0;
    	}
    	return tmp;
    }
    
    NOTE: x and y should be sorted in increasing order before calling this function.
    real(8) function code(x, y)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        real(8) :: t_0
        real(8) :: tmp
        t_0 = y * (x + 1.0d0)
        if (y <= (-1.0d0)) then
            tmp = t_0
        else if (y <= 0.0065d0) then
            tmp = x + y
        else
            tmp = t_0
        end if
        code = tmp
    end function
    
    assert x < y;
    public static double code(double x, double y) {
    	double t_0 = y * (x + 1.0);
    	double tmp;
    	if (y <= -1.0) {
    		tmp = t_0;
    	} else if (y <= 0.0065) {
    		tmp = x + y;
    	} else {
    		tmp = t_0;
    	}
    	return tmp;
    }
    
    [x, y] = sort([x, y])
    def code(x, y):
    	t_0 = y * (x + 1.0)
    	tmp = 0
    	if y <= -1.0:
    		tmp = t_0
    	elif y <= 0.0065:
    		tmp = x + y
    	else:
    		tmp = t_0
    	return tmp
    
    x, y = sort([x, y])
    function code(x, y)
    	t_0 = Float64(y * Float64(x + 1.0))
    	tmp = 0.0
    	if (y <= -1.0)
    		tmp = t_0;
    	elseif (y <= 0.0065)
    		tmp = Float64(x + y);
    	else
    		tmp = t_0;
    	end
    	return tmp
    end
    
    x, y = num2cell(sort([x, y])){:}
    function tmp_2 = code(x, y)
    	t_0 = y * (x + 1.0);
    	tmp = 0.0;
    	if (y <= -1.0)
    		tmp = t_0;
    	elseif (y <= 0.0065)
    		tmp = x + y;
    	else
    		tmp = t_0;
    	end
    	tmp_2 = tmp;
    end
    
    NOTE: x and y should be sorted in increasing order before calling this function.
    code[x_, y_] := Block[{t$95$0 = N[(y * N[(x + 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1.0], t$95$0, If[LessEqual[y, 0.0065], N[(x + y), $MachinePrecision], t$95$0]]]
    
    \begin{array}{l}
    [x, y] = \mathsf{sort}([x, y])\\
    \\
    \begin{array}{l}
    t_0 := y \cdot \left(x + 1\right)\\
    \mathbf{if}\;y \leq -1:\\
    \;\;\;\;t\_0\\
    
    \mathbf{elif}\;y \leq 0.0065:\\
    \;\;\;\;x + y\\
    
    \mathbf{else}:\\
    \;\;\;\;t\_0\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if y < -1 or 0.0064999999999999997 < y

      1. Initial program 100.0%

        \[\left(x \cdot y + x\right) + y \]
      2. Step-by-step derivation
        1. associate-+l+N/A

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

          \[\leadsto \left(x + y\right) + \color{blue}{x \cdot y} \]
        3. associate-+l+N/A

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

          \[\leadsto \mathsf{+.f64}\left(x, \color{blue}{\left(y + x \cdot y\right)}\right) \]
        5. distribute-rgt1-inN/A

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

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

          \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(y, \color{blue}{\left(x + 1\right)}\right)\right) \]
        8. +-lowering-+.f64100.0%

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

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

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

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

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

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

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

      if -1 < y < 0.0064999999999999997

      1. Initial program 100.0%

        \[\left(x \cdot y + x\right) + y \]
      2. Step-by-step derivation
        1. associate-+l+N/A

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

          \[\leadsto \left(x + y\right) + \color{blue}{x \cdot y} \]
        3. associate-+l+N/A

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

          \[\leadsto \mathsf{+.f64}\left(x, \color{blue}{\left(y + x \cdot y\right)}\right) \]
        5. distribute-rgt1-inN/A

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

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

          \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(y, \color{blue}{\left(x + 1\right)}\right)\right) \]
        8. +-lowering-+.f64100.0%

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

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

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

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

      Alternative 4: 69.7% accurate, 0.6× speedup?

      \[\begin{array}{l} [x, y] = \mathsf{sort}([x, y])\\ \\ \begin{array}{l} \mathbf{if}\;y \leq -1:\\ \;\;\;\;x \cdot y\\ \mathbf{elif}\;y \leq 4 \cdot 10^{-91}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;y\\ \end{array} \end{array} \]
      NOTE: x and y should be sorted in increasing order before calling this function.
      (FPCore (x y)
       :precision binary64
       (if (<= y -1.0) (* x y) (if (<= y 4e-91) x y)))
      assert(x < y);
      double code(double x, double y) {
      	double tmp;
      	if (y <= -1.0) {
      		tmp = x * y;
      	} else if (y <= 4e-91) {
      		tmp = x;
      	} else {
      		tmp = y;
      	}
      	return tmp;
      }
      
      NOTE: x and y should be sorted in increasing order before calling this function.
      real(8) function code(x, y)
          real(8), intent (in) :: x
          real(8), intent (in) :: y
          real(8) :: tmp
          if (y <= (-1.0d0)) then
              tmp = x * y
          else if (y <= 4d-91) then
              tmp = x
          else
              tmp = y
          end if
          code = tmp
      end function
      
      assert x < y;
      public static double code(double x, double y) {
      	double tmp;
      	if (y <= -1.0) {
      		tmp = x * y;
      	} else if (y <= 4e-91) {
      		tmp = x;
      	} else {
      		tmp = y;
      	}
      	return tmp;
      }
      
      [x, y] = sort([x, y])
      def code(x, y):
      	tmp = 0
      	if y <= -1.0:
      		tmp = x * y
      	elif y <= 4e-91:
      		tmp = x
      	else:
      		tmp = y
      	return tmp
      
      x, y = sort([x, y])
      function code(x, y)
      	tmp = 0.0
      	if (y <= -1.0)
      		tmp = Float64(x * y);
      	elseif (y <= 4e-91)
      		tmp = x;
      	else
      		tmp = y;
      	end
      	return tmp
      end
      
      x, y = num2cell(sort([x, y])){:}
      function tmp_2 = code(x, y)
      	tmp = 0.0;
      	if (y <= -1.0)
      		tmp = x * y;
      	elseif (y <= 4e-91)
      		tmp = x;
      	else
      		tmp = y;
      	end
      	tmp_2 = tmp;
      end
      
      NOTE: x and y should be sorted in increasing order before calling this function.
      code[x_, y_] := If[LessEqual[y, -1.0], N[(x * y), $MachinePrecision], If[LessEqual[y, 4e-91], x, y]]
      
      \begin{array}{l}
      [x, y] = \mathsf{sort}([x, y])\\
      \\
      \begin{array}{l}
      \mathbf{if}\;y \leq -1:\\
      \;\;\;\;x \cdot y\\
      
      \mathbf{elif}\;y \leq 4 \cdot 10^{-91}:\\
      \;\;\;\;x\\
      
      \mathbf{else}:\\
      \;\;\;\;y\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 3 regimes
      2. if y < -1

        1. Initial program 100.0%

          \[\left(x \cdot y + x\right) + y \]
        2. Step-by-step derivation
          1. associate-+l+N/A

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

            \[\leadsto \left(x + y\right) + \color{blue}{x \cdot y} \]
          3. associate-+l+N/A

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

            \[\leadsto \mathsf{+.f64}\left(x, \color{blue}{\left(y + x \cdot y\right)}\right) \]
          5. distribute-rgt1-inN/A

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

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

            \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(y, \color{blue}{\left(x + 1\right)}\right)\right) \]
          8. +-lowering-+.f64100.0%

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

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

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

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

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

            \[\leadsto \mathsf{*.f64}\left(y, \mathsf{+.f64}\left(x, \color{blue}{1}\right)\right) \]
        7. Simplified98.0%

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

          \[\leadsto \mathsf{*.f64}\left(y, \color{blue}{x}\right) \]
        9. Step-by-step derivation
          1. Simplified48.8%

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

          if -1 < y < 4.00000000000000009e-91

          1. Initial program 100.0%

            \[\left(x \cdot y + x\right) + y \]
          2. Step-by-step derivation
            1. associate-+l+N/A

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

              \[\leadsto \left(x + y\right) + \color{blue}{x \cdot y} \]
            3. associate-+l+N/A

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

              \[\leadsto \mathsf{+.f64}\left(x, \color{blue}{\left(y + x \cdot y\right)}\right) \]
            5. distribute-rgt1-inN/A

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

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

              \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(y, \color{blue}{\left(x + 1\right)}\right)\right) \]
            8. +-lowering-+.f64100.0%

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

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

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

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

            if 4.00000000000000009e-91 < y

            1. Initial program 99.9%

              \[\left(x \cdot y + x\right) + y \]
            2. Step-by-step derivation
              1. associate-+l+N/A

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

                \[\leadsto \left(x + y\right) + \color{blue}{x \cdot y} \]
              3. associate-+l+N/A

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

                \[\leadsto \mathsf{+.f64}\left(x, \color{blue}{\left(y + x \cdot y\right)}\right) \]
              5. distribute-rgt1-inN/A

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

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

                \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(y, \color{blue}{\left(x + 1\right)}\right)\right) \]
              8. +-lowering-+.f64100.0%

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

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

              \[\leadsto \color{blue}{y} \]
            6. Step-by-step derivation
              1. Simplified53.8%

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

              \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1:\\ \;\;\;\;x \cdot y\\ \mathbf{elif}\;y \leq 4 \cdot 10^{-91}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;y\\ \end{array} \]
            9. Add Preprocessing

            Alternative 5: 80.7% accurate, 0.9× speedup?

            \[\begin{array}{l} [x, y] = \mathsf{sort}([x, y])\\ \\ \begin{array}{l} \mathbf{if}\;y \leq -28000:\\ \;\;\;\;x \cdot y\\ \mathbf{else}:\\ \;\;\;\;x + y\\ \end{array} \end{array} \]
            NOTE: x and y should be sorted in increasing order before calling this function.
            (FPCore (x y) :precision binary64 (if (<= y -28000.0) (* x y) (+ x y)))
            assert(x < y);
            double code(double x, double y) {
            	double tmp;
            	if (y <= -28000.0) {
            		tmp = x * y;
            	} else {
            		tmp = x + y;
            	}
            	return tmp;
            }
            
            NOTE: x and y should be sorted in increasing order before calling this function.
            real(8) function code(x, y)
                real(8), intent (in) :: x
                real(8), intent (in) :: y
                real(8) :: tmp
                if (y <= (-28000.0d0)) then
                    tmp = x * y
                else
                    tmp = x + y
                end if
                code = tmp
            end function
            
            assert x < y;
            public static double code(double x, double y) {
            	double tmp;
            	if (y <= -28000.0) {
            		tmp = x * y;
            	} else {
            		tmp = x + y;
            	}
            	return tmp;
            }
            
            [x, y] = sort([x, y])
            def code(x, y):
            	tmp = 0
            	if y <= -28000.0:
            		tmp = x * y
            	else:
            		tmp = x + y
            	return tmp
            
            x, y = sort([x, y])
            function code(x, y)
            	tmp = 0.0
            	if (y <= -28000.0)
            		tmp = Float64(x * y);
            	else
            		tmp = Float64(x + y);
            	end
            	return tmp
            end
            
            x, y = num2cell(sort([x, y])){:}
            function tmp_2 = code(x, y)
            	tmp = 0.0;
            	if (y <= -28000.0)
            		tmp = x * y;
            	else
            		tmp = x + y;
            	end
            	tmp_2 = tmp;
            end
            
            NOTE: x and y should be sorted in increasing order before calling this function.
            code[x_, y_] := If[LessEqual[y, -28000.0], N[(x * y), $MachinePrecision], N[(x + y), $MachinePrecision]]
            
            \begin{array}{l}
            [x, y] = \mathsf{sort}([x, y])\\
            \\
            \begin{array}{l}
            \mathbf{if}\;y \leq -28000:\\
            \;\;\;\;x \cdot y\\
            
            \mathbf{else}:\\
            \;\;\;\;x + y\\
            
            
            \end{array}
            \end{array}
            
            Derivation
            1. Split input into 2 regimes
            2. if y < -28000

              1. Initial program 100.0%

                \[\left(x \cdot y + x\right) + y \]
              2. Step-by-step derivation
                1. associate-+l+N/A

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

                  \[\leadsto \left(x + y\right) + \color{blue}{x \cdot y} \]
                3. associate-+l+N/A

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

                  \[\leadsto \mathsf{+.f64}\left(x, \color{blue}{\left(y + x \cdot y\right)}\right) \]
                5. distribute-rgt1-inN/A

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

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

                  \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(y, \color{blue}{\left(x + 1\right)}\right)\right) \]
                8. +-lowering-+.f64100.0%

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

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

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

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

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

                  \[\leadsto \mathsf{*.f64}\left(y, \mathsf{+.f64}\left(x, \color{blue}{1}\right)\right) \]
              7. Simplified98.0%

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

                \[\leadsto \mathsf{*.f64}\left(y, \color{blue}{x}\right) \]
              9. Step-by-step derivation
                1. Simplified48.8%

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

                if -28000 < y

                1. Initial program 100.0%

                  \[\left(x \cdot y + x\right) + y \]
                2. Step-by-step derivation
                  1. associate-+l+N/A

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

                    \[\leadsto \left(x + y\right) + \color{blue}{x \cdot y} \]
                  3. associate-+l+N/A

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

                    \[\leadsto \mathsf{+.f64}\left(x, \color{blue}{\left(y + x \cdot y\right)}\right) \]
                  5. distribute-rgt1-inN/A

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

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

                    \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(y, \color{blue}{\left(x + 1\right)}\right)\right) \]
                  8. +-lowering-+.f64100.0%

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

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

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

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

                  \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -28000:\\ \;\;\;\;x \cdot y\\ \mathbf{else}:\\ \;\;\;\;x + y\\ \end{array} \]
                9. Add Preprocessing

                Alternative 6: 63.9% accurate, 1.2× speedup?

                \[\begin{array}{l} [x, y] = \mathsf{sort}([x, y])\\ \\ \begin{array}{l} \mathbf{if}\;y \leq 4.3 \cdot 10^{-91}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;y\\ \end{array} \end{array} \]
                NOTE: x and y should be sorted in increasing order before calling this function.
                (FPCore (x y) :precision binary64 (if (<= y 4.3e-91) x y))
                assert(x < y);
                double code(double x, double y) {
                	double tmp;
                	if (y <= 4.3e-91) {
                		tmp = x;
                	} else {
                		tmp = y;
                	}
                	return tmp;
                }
                
                NOTE: x and y should be sorted in increasing order before calling this function.
                real(8) function code(x, y)
                    real(8), intent (in) :: x
                    real(8), intent (in) :: y
                    real(8) :: tmp
                    if (y <= 4.3d-91) then
                        tmp = x
                    else
                        tmp = y
                    end if
                    code = tmp
                end function
                
                assert x < y;
                public static double code(double x, double y) {
                	double tmp;
                	if (y <= 4.3e-91) {
                		tmp = x;
                	} else {
                		tmp = y;
                	}
                	return tmp;
                }
                
                [x, y] = sort([x, y])
                def code(x, y):
                	tmp = 0
                	if y <= 4.3e-91:
                		tmp = x
                	else:
                		tmp = y
                	return tmp
                
                x, y = sort([x, y])
                function code(x, y)
                	tmp = 0.0
                	if (y <= 4.3e-91)
                		tmp = x;
                	else
                		tmp = y;
                	end
                	return tmp
                end
                
                x, y = num2cell(sort([x, y])){:}
                function tmp_2 = code(x, y)
                	tmp = 0.0;
                	if (y <= 4.3e-91)
                		tmp = x;
                	else
                		tmp = y;
                	end
                	tmp_2 = tmp;
                end
                
                NOTE: x and y should be sorted in increasing order before calling this function.
                code[x_, y_] := If[LessEqual[y, 4.3e-91], x, y]
                
                \begin{array}{l}
                [x, y] = \mathsf{sort}([x, y])\\
                \\
                \begin{array}{l}
                \mathbf{if}\;y \leq 4.3 \cdot 10^{-91}:\\
                \;\;\;\;x\\
                
                \mathbf{else}:\\
                \;\;\;\;y\\
                
                
                \end{array}
                \end{array}
                
                Derivation
                1. Split input into 2 regimes
                2. if y < 4.3e-91

                  1. Initial program 100.0%

                    \[\left(x \cdot y + x\right) + y \]
                  2. Step-by-step derivation
                    1. associate-+l+N/A

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

                      \[\leadsto \left(x + y\right) + \color{blue}{x \cdot y} \]
                    3. associate-+l+N/A

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

                      \[\leadsto \mathsf{+.f64}\left(x, \color{blue}{\left(y + x \cdot y\right)}\right) \]
                    5. distribute-rgt1-inN/A

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

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

                      \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(y, \color{blue}{\left(x + 1\right)}\right)\right) \]
                    8. +-lowering-+.f64100.0%

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

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

                    \[\leadsto \color{blue}{x} \]
                  6. Step-by-step derivation
                    1. Simplified51.8%

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

                    if 4.3e-91 < y

                    1. Initial program 99.9%

                      \[\left(x \cdot y + x\right) + y \]
                    2. Step-by-step derivation
                      1. associate-+l+N/A

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

                        \[\leadsto \left(x + y\right) + \color{blue}{x \cdot y} \]
                      3. associate-+l+N/A

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

                        \[\leadsto \mathsf{+.f64}\left(x, \color{blue}{\left(y + x \cdot y\right)}\right) \]
                      5. distribute-rgt1-inN/A

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

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

                        \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(y, \color{blue}{\left(x + 1\right)}\right)\right) \]
                      8. +-lowering-+.f64100.0%

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

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

                      \[\leadsto \color{blue}{y} \]
                    6. Step-by-step derivation
                      1. Simplified53.8%

                        \[\leadsto \color{blue}{y} \]
                    7. Recombined 2 regimes into one program.
                    8. Add Preprocessing

                    Alternative 7: 39.5% accurate, 7.0× speedup?

                    \[\begin{array}{l} [x, y] = \mathsf{sort}([x, y])\\ \\ x \end{array} \]
                    NOTE: x and y should be sorted in increasing order before calling this function.
                    (FPCore (x y) :precision binary64 x)
                    assert(x < y);
                    double code(double x, double y) {
                    	return x;
                    }
                    
                    NOTE: x and y should be sorted in increasing order before calling this function.
                    real(8) function code(x, y)
                        real(8), intent (in) :: x
                        real(8), intent (in) :: y
                        code = x
                    end function
                    
                    assert x < y;
                    public static double code(double x, double y) {
                    	return x;
                    }
                    
                    [x, y] = sort([x, y])
                    def code(x, y):
                    	return x
                    
                    x, y = sort([x, y])
                    function code(x, y)
                    	return x
                    end
                    
                    x, y = num2cell(sort([x, y])){:}
                    function tmp = code(x, y)
                    	tmp = x;
                    end
                    
                    NOTE: x and y should be sorted in increasing order before calling this function.
                    code[x_, y_] := x
                    
                    \begin{array}{l}
                    [x, y] = \mathsf{sort}([x, y])\\
                    \\
                    x
                    \end{array}
                    
                    Derivation
                    1. Initial program 100.0%

                      \[\left(x \cdot y + x\right) + y \]
                    2. Step-by-step derivation
                      1. associate-+l+N/A

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

                        \[\leadsto \left(x + y\right) + \color{blue}{x \cdot y} \]
                      3. associate-+l+N/A

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

                        \[\leadsto \mathsf{+.f64}\left(x, \color{blue}{\left(y + x \cdot y\right)}\right) \]
                      5. distribute-rgt1-inN/A

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

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

                        \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(y, \color{blue}{\left(x + 1\right)}\right)\right) \]
                      8. +-lowering-+.f64100.0%

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

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

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

                        \[\leadsto \color{blue}{x} \]
                      2. Add Preprocessing

                      Reproduce

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