Data.Colour.SRGB:transferFunction from colour-2.3.3

Percentage Accurate: 100.0% → 100.0%
Time: 5.5s
Alternatives: 9
Speedup: 1.0×

Specification

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

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

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

Alternative 1: 100.0% accurate, 1.0× speedup?

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

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

    \[\left(x + 1\right) \cdot y - x \]
  2. Add Preprocessing
  3. Add Preprocessing

Alternative 2: 62.1% accurate, 0.4× speedup?

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

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

\mathbf{elif}\;x \leq -1.4 \cdot 10^{-62}:\\
\;\;\;\;0 - x\\

\mathbf{elif}\;x \leq 2.3 \cdot 10^{-24}:\\
\;\;\;\;y\\

\mathbf{else}:\\
\;\;\;\;0 - x\\


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

    1. Initial program 100.0%

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

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

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

        \[\leadsto \left(y + y \cdot x\right) + \left(\mathsf{neg}\left(x\right)\right) \]
      4. associate-+l+N/A

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

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

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

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

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

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

      \[\leadsto \color{blue}{y + x \cdot \left(y + -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-+.f6460.9%

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

      \[\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. Simplified60.9%

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

      if -1.7500000000000001e168 < x < -1.40000000000000001e-62 or 2.3000000000000001e-24 < x

      1. Initial program 100.0%

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

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

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

          \[\leadsto \left(y + y \cdot x\right) + \left(\mathsf{neg}\left(x\right)\right) \]
        4. associate-+l+N/A

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{-1 \cdot x} \]
      6. Step-by-step derivation
        1. mul-1-negN/A

          \[\leadsto \mathsf{neg}\left(x\right) \]
        2. neg-sub0N/A

          \[\leadsto 0 - \color{blue}{x} \]
        3. --lowering--.f6459.5%

          \[\leadsto \mathsf{\_.f64}\left(0, \color{blue}{x}\right) \]
      7. Simplified59.5%

        \[\leadsto \color{blue}{0 - x} \]
      8. Step-by-step derivation
        1. sub0-negN/A

          \[\leadsto \mathsf{neg}\left(x\right) \]
        2. neg-lowering-neg.f6459.5%

          \[\leadsto \mathsf{neg.f64}\left(x\right) \]
      9. Applied egg-rr59.5%

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

      if -1.40000000000000001e-62 < x < 2.3000000000000001e-24

      1. Initial program 100.0%

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

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

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

          \[\leadsto \left(y + y \cdot x\right) + \left(\mathsf{neg}\left(x\right)\right) \]
        4. associate-+l+N/A

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

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

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

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

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

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

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

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

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

        \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -1.75 \cdot 10^{+168}:\\ \;\;\;\;x \cdot y\\ \mathbf{elif}\;x \leq -1.4 \cdot 10^{-62}:\\ \;\;\;\;0 - x\\ \mathbf{elif}\;x \leq 2.3 \cdot 10^{-24}:\\ \;\;\;\;y\\ \mathbf{else}:\\ \;\;\;\;0 - x\\ \end{array} \]
      9. Add Preprocessing

      Alternative 3: 98.6% accurate, 0.5× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -12500000:\\ \;\;\;\;x \cdot \left(y + -1\right)\\ \mathbf{elif}\;x \leq 1:\\ \;\;\;\;y - x\\ \mathbf{else}:\\ \;\;\;\;x \cdot y - x\\ \end{array} \end{array} \]
      (FPCore (x y)
       :precision binary64
       (if (<= x -12500000.0)
         (* x (+ y -1.0))
         (if (<= x 1.0) (- y x) (- (* x y) x))))
      double code(double x, double y) {
      	double tmp;
      	if (x <= -12500000.0) {
      		tmp = x * (y + -1.0);
      	} else if (x <= 1.0) {
      		tmp = y - x;
      	} else {
      		tmp = (x * 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 <= (-12500000.0d0)) then
              tmp = x * (y + (-1.0d0))
          else if (x <= 1.0d0) then
              tmp = y - x
          else
              tmp = (x * y) - x
          end if
          code = tmp
      end function
      
      public static double code(double x, double y) {
      	double tmp;
      	if (x <= -12500000.0) {
      		tmp = x * (y + -1.0);
      	} else if (x <= 1.0) {
      		tmp = y - x;
      	} else {
      		tmp = (x * y) - x;
      	}
      	return tmp;
      }
      
      def code(x, y):
      	tmp = 0
      	if x <= -12500000.0:
      		tmp = x * (y + -1.0)
      	elif x <= 1.0:
      		tmp = y - x
      	else:
      		tmp = (x * y) - x
      	return tmp
      
      function code(x, y)
      	tmp = 0.0
      	if (x <= -12500000.0)
      		tmp = Float64(x * Float64(y + -1.0));
      	elseif (x <= 1.0)
      		tmp = Float64(y - x);
      	else
      		tmp = Float64(Float64(x * y) - x);
      	end
      	return tmp
      end
      
      function tmp_2 = code(x, y)
      	tmp = 0.0;
      	if (x <= -12500000.0)
      		tmp = x * (y + -1.0);
      	elseif (x <= 1.0)
      		tmp = y - x;
      	else
      		tmp = (x * y) - x;
      	end
      	tmp_2 = tmp;
      end
      
      code[x_, y_] := If[LessEqual[x, -12500000.0], N[(x * N[(y + -1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.0], N[(y - x), $MachinePrecision], N[(N[(x * y), $MachinePrecision] - x), $MachinePrecision]]]
      
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      \mathbf{if}\;x \leq -12500000:\\
      \;\;\;\;x \cdot \left(y + -1\right)\\
      
      \mathbf{elif}\;x \leq 1:\\
      \;\;\;\;y - x\\
      
      \mathbf{else}:\\
      \;\;\;\;x \cdot y - x\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 3 regimes
      2. if x < -1.25e7

        1. Initial program 100.0%

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

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

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

            \[\leadsto \left(y + y \cdot x\right) + \left(\mathsf{neg}\left(x\right)\right) \]
          4. associate-+l+N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        if -1.25e7 < x < 1

        1. Initial program 100.0%

          \[\left(x + 1\right) \cdot y - x \]
        2. Add Preprocessing
        3. Taylor expanded in x around 0

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

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

          if 1 < x

          1. Initial program 100.0%

            \[\left(x + 1\right) \cdot y - x \]
          2. Add Preprocessing
          3. Taylor expanded in x around inf

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

              \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(x, y\right), x\right) \]
          5. Simplified98.7%

            \[\leadsto \color{blue}{x \cdot y} - x \]
        5. Recombined 3 regimes into one program.
        6. Final simplification99.0%

          \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -12500000:\\ \;\;\;\;x \cdot \left(y + -1\right)\\ \mathbf{elif}\;x \leq 1:\\ \;\;\;\;y - x\\ \mathbf{else}:\\ \;\;\;\;x \cdot y - x\\ \end{array} \]
        7. Add Preprocessing

        Alternative 4: 98.6% accurate, 0.5× speedup?

        \[\begin{array}{l} \\ \begin{array}{l} t_0 := x \cdot \left(y + -1\right)\\ \mathbf{if}\;x \leq -12500000:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;x \leq 1:\\ \;\;\;\;y - x\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
        (FPCore (x y)
         :precision binary64
         (let* ((t_0 (* x (+ y -1.0))))
           (if (<= x -12500000.0) t_0 (if (<= x 1.0) (- y x) t_0))))
        double code(double x, double y) {
        	double t_0 = x * (y + -1.0);
        	double tmp;
        	if (x <= -12500000.0) {
        		tmp = t_0;
        	} else if (x <= 1.0) {
        		tmp = y - x;
        	} else {
        		tmp = t_0;
        	}
        	return tmp;
        }
        
        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 = x * (y + (-1.0d0))
            if (x <= (-12500000.0d0)) then
                tmp = t_0
            else if (x <= 1.0d0) then
                tmp = y - x
            else
                tmp = t_0
            end if
            code = tmp
        end function
        
        public static double code(double x, double y) {
        	double t_0 = x * (y + -1.0);
        	double tmp;
        	if (x <= -12500000.0) {
        		tmp = t_0;
        	} else if (x <= 1.0) {
        		tmp = y - x;
        	} else {
        		tmp = t_0;
        	}
        	return tmp;
        }
        
        def code(x, y):
        	t_0 = x * (y + -1.0)
        	tmp = 0
        	if x <= -12500000.0:
        		tmp = t_0
        	elif x <= 1.0:
        		tmp = y - x
        	else:
        		tmp = t_0
        	return tmp
        
        function code(x, y)
        	t_0 = Float64(x * Float64(y + -1.0))
        	tmp = 0.0
        	if (x <= -12500000.0)
        		tmp = t_0;
        	elseif (x <= 1.0)
        		tmp = Float64(y - x);
        	else
        		tmp = t_0;
        	end
        	return tmp
        end
        
        function tmp_2 = code(x, y)
        	t_0 = x * (y + -1.0);
        	tmp = 0.0;
        	if (x <= -12500000.0)
        		tmp = t_0;
        	elseif (x <= 1.0)
        		tmp = y - x;
        	else
        		tmp = t_0;
        	end
        	tmp_2 = tmp;
        end
        
        code[x_, y_] := Block[{t$95$0 = N[(x * N[(y + -1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -12500000.0], t$95$0, If[LessEqual[x, 1.0], N[(y - x), $MachinePrecision], t$95$0]]]
        
        \begin{array}{l}
        
        \\
        \begin{array}{l}
        t_0 := x \cdot \left(y + -1\right)\\
        \mathbf{if}\;x \leq -12500000:\\
        \;\;\;\;t\_0\\
        
        \mathbf{elif}\;x \leq 1:\\
        \;\;\;\;y - x\\
        
        \mathbf{else}:\\
        \;\;\;\;t\_0\\
        
        
        \end{array}
        \end{array}
        
        Derivation
        1. Split input into 2 regimes
        2. if x < -1.25e7 or 1 < x

          1. Initial program 100.0%

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

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

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

              \[\leadsto \left(y + y \cdot x\right) + \left(\mathsf{neg}\left(x\right)\right) \]
            4. associate-+l+N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          if -1.25e7 < x < 1

          1. Initial program 100.0%

            \[\left(x + 1\right) \cdot y - x \]
          2. Add Preprocessing
          3. Taylor expanded in x around 0

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

              \[\leadsto \color{blue}{y} - x \]
          5. Recombined 2 regimes into one program.
          6. Final simplification99.0%

            \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -12500000:\\ \;\;\;\;x \cdot \left(y + -1\right)\\ \mathbf{elif}\;x \leq 1:\\ \;\;\;\;y - x\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(y + -1\right)\\ \end{array} \]
          7. Add Preprocessing

          Alternative 5: 62.5% accurate, 0.5× speedup?

          \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -2.5 \cdot 10^{-62}:\\ \;\;\;\;0 - x\\ \mathbf{elif}\;x \leq 7 \cdot 10^{-25}:\\ \;\;\;\;y\\ \mathbf{else}:\\ \;\;\;\;0 - x\\ \end{array} \end{array} \]
          (FPCore (x y)
           :precision binary64
           (if (<= x -2.5e-62) (- 0.0 x) (if (<= x 7e-25) y (- 0.0 x))))
          double code(double x, double y) {
          	double tmp;
          	if (x <= -2.5e-62) {
          		tmp = 0.0 - x;
          	} else if (x <= 7e-25) {
          		tmp = y;
          	} else {
          		tmp = 0.0 - x;
          	}
          	return tmp;
          }
          
          real(8) function code(x, y)
              real(8), intent (in) :: x
              real(8), intent (in) :: y
              real(8) :: tmp
              if (x <= (-2.5d-62)) then
                  tmp = 0.0d0 - x
              else if (x <= 7d-25) then
                  tmp = y
              else
                  tmp = 0.0d0 - x
              end if
              code = tmp
          end function
          
          public static double code(double x, double y) {
          	double tmp;
          	if (x <= -2.5e-62) {
          		tmp = 0.0 - x;
          	} else if (x <= 7e-25) {
          		tmp = y;
          	} else {
          		tmp = 0.0 - x;
          	}
          	return tmp;
          }
          
          def code(x, y):
          	tmp = 0
          	if x <= -2.5e-62:
          		tmp = 0.0 - x
          	elif x <= 7e-25:
          		tmp = y
          	else:
          		tmp = 0.0 - x
          	return tmp
          
          function code(x, y)
          	tmp = 0.0
          	if (x <= -2.5e-62)
          		tmp = Float64(0.0 - x);
          	elseif (x <= 7e-25)
          		tmp = y;
          	else
          		tmp = Float64(0.0 - x);
          	end
          	return tmp
          end
          
          function tmp_2 = code(x, y)
          	tmp = 0.0;
          	if (x <= -2.5e-62)
          		tmp = 0.0 - x;
          	elseif (x <= 7e-25)
          		tmp = y;
          	else
          		tmp = 0.0 - x;
          	end
          	tmp_2 = tmp;
          end
          
          code[x_, y_] := If[LessEqual[x, -2.5e-62], N[(0.0 - x), $MachinePrecision], If[LessEqual[x, 7e-25], y, N[(0.0 - x), $MachinePrecision]]]
          
          \begin{array}{l}
          
          \\
          \begin{array}{l}
          \mathbf{if}\;x \leq -2.5 \cdot 10^{-62}:\\
          \;\;\;\;0 - x\\
          
          \mathbf{elif}\;x \leq 7 \cdot 10^{-25}:\\
          \;\;\;\;y\\
          
          \mathbf{else}:\\
          \;\;\;\;0 - x\\
          
          
          \end{array}
          \end{array}
          
          Derivation
          1. Split input into 2 regimes
          2. if x < -2.5000000000000001e-62 or 7.0000000000000004e-25 < x

            1. Initial program 100.0%

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

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

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

                \[\leadsto \left(y + y \cdot x\right) + \left(\mathsf{neg}\left(x\right)\right) \]
              4. associate-+l+N/A

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

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

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

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

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

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

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

              \[\leadsto \color{blue}{-1 \cdot x} \]
            6. Step-by-step derivation
              1. mul-1-negN/A

                \[\leadsto \mathsf{neg}\left(x\right) \]
              2. neg-sub0N/A

                \[\leadsto 0 - \color{blue}{x} \]
              3. --lowering--.f6455.4%

                \[\leadsto \mathsf{\_.f64}\left(0, \color{blue}{x}\right) \]
            7. Simplified55.4%

              \[\leadsto \color{blue}{0 - x} \]
            8. Step-by-step derivation
              1. sub0-negN/A

                \[\leadsto \mathsf{neg}\left(x\right) \]
              2. neg-lowering-neg.f6455.4%

                \[\leadsto \mathsf{neg.f64}\left(x\right) \]
            9. Applied egg-rr55.4%

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

            if -2.5000000000000001e-62 < x < 7.0000000000000004e-25

            1. Initial program 100.0%

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

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

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

                \[\leadsto \left(y + y \cdot x\right) + \left(\mathsf{neg}\left(x\right)\right) \]
              4. associate-+l+N/A

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

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

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

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

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

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

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

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

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

              \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -2.5 \cdot 10^{-62}:\\ \;\;\;\;0 - x\\ \mathbf{elif}\;x \leq 7 \cdot 10^{-25}:\\ \;\;\;\;y\\ \mathbf{else}:\\ \;\;\;\;0 - x\\ \end{array} \]
            9. Add Preprocessing

            Alternative 6: 74.2% accurate, 0.9× speedup?

            \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -1260000000:\\ \;\;\;\;x \cdot y\\ \mathbf{else}:\\ \;\;\;\;y - x\\ \end{array} \end{array} \]
            (FPCore (x y) :precision binary64 (if (<= y -1260000000.0) (* x y) (- y x)))
            double code(double x, double y) {
            	double tmp;
            	if (y <= -1260000000.0) {
            		tmp = x * 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 (y <= (-1260000000.0d0)) then
                    tmp = x * y
                else
                    tmp = y - x
                end if
                code = tmp
            end function
            
            public static double code(double x, double y) {
            	double tmp;
            	if (y <= -1260000000.0) {
            		tmp = x * y;
            	} else {
            		tmp = y - x;
            	}
            	return tmp;
            }
            
            def code(x, y):
            	tmp = 0
            	if y <= -1260000000.0:
            		tmp = x * y
            	else:
            		tmp = y - x
            	return tmp
            
            function code(x, y)
            	tmp = 0.0
            	if (y <= -1260000000.0)
            		tmp = Float64(x * y);
            	else
            		tmp = Float64(y - x);
            	end
            	return tmp
            end
            
            function tmp_2 = code(x, y)
            	tmp = 0.0;
            	if (y <= -1260000000.0)
            		tmp = x * y;
            	else
            		tmp = y - x;
            	end
            	tmp_2 = tmp;
            end
            
            code[x_, y_] := If[LessEqual[y, -1260000000.0], N[(x * y), $MachinePrecision], N[(y - x), $MachinePrecision]]
            
            \begin{array}{l}
            
            \\
            \begin{array}{l}
            \mathbf{if}\;y \leq -1260000000:\\
            \;\;\;\;x \cdot y\\
            
            \mathbf{else}:\\
            \;\;\;\;y - x\\
            
            
            \end{array}
            \end{array}
            
            Derivation
            1. Split input into 2 regimes
            2. if y < -1.26e9

              1. Initial program 100.0%

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

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

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

                  \[\leadsto \left(y + y \cdot x\right) + \left(\mathsf{neg}\left(x\right)\right) \]
                4. associate-+l+N/A

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

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

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

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

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

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

                \[\leadsto \color{blue}{y + x \cdot \left(y + -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-+.f64100.0%

                  \[\leadsto \mathsf{*.f64}\left(y, \mathsf{+.f64}\left(x, \color{blue}{1}\right)\right) \]
              7. Simplified100.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. Simplified57.7%

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

                if -1.26e9 < y

                1. Initial program 100.0%

                  \[\left(x + 1\right) \cdot y - x \]
                2. Add Preprocessing
                3. Taylor expanded in x around 0

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

                    \[\leadsto \color{blue}{y} - x \]
                5. Recombined 2 regimes into one program.
                6. Final simplification78.3%

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

                Alternative 7: 100.0% accurate, 1.0× speedup?

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

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

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

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

                    \[\leadsto \left(y + y \cdot x\right) + \left(\mathsf{neg}\left(x\right)\right) \]
                  4. associate-+l+N/A

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

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

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

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

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

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

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

                Alternative 8: 38.9% accurate, 7.0× speedup?

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

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

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

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

                    \[\leadsto \left(y + y \cdot x\right) + \left(\mathsf{neg}\left(x\right)\right) \]
                  4. associate-+l+N/A

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

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

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

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

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

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

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

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

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

                  Alternative 9: 2.7% 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 + 1\right) \cdot y - x \]
                  2. Step-by-step derivation
                    1. sub-negN/A

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

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

                      \[\leadsto \left(y + y \cdot x\right) + \left(\mathsf{neg}\left(x\right)\right) \]
                    4. associate-+l+N/A

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

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

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

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

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

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

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

                    \[\leadsto \color{blue}{-1 \cdot x} \]
                  6. Step-by-step derivation
                    1. mul-1-negN/A

                      \[\leadsto \mathsf{neg}\left(x\right) \]
                    2. neg-sub0N/A

                      \[\leadsto 0 - \color{blue}{x} \]
                    3. --lowering--.f6441.0%

                      \[\leadsto \mathsf{\_.f64}\left(0, \color{blue}{x}\right) \]
                  7. Simplified41.0%

                    \[\leadsto \color{blue}{0 - x} \]
                  8. Step-by-step derivation
                    1. sub0-negN/A

                      \[\leadsto \mathsf{neg}\left(x\right) \]
                    2. neg-lowering-neg.f6441.0%

                      \[\leadsto \mathsf{neg.f64}\left(x\right) \]
                  9. Applied egg-rr41.0%

                    \[\leadsto \color{blue}{-x} \]
                  10. Step-by-step derivation
                    1. neg-sub0N/A

                      \[\leadsto 0 - \color{blue}{x} \]
                    2. flip3--N/A

                      \[\leadsto \frac{{0}^{3} - {x}^{3}}{\color{blue}{0 \cdot 0 + \left(x \cdot x + 0 \cdot x\right)}} \]
                    3. metadata-evalN/A

                      \[\leadsto \frac{0 - {x}^{3}}{\color{blue}{0} \cdot 0 + \left(x \cdot x + 0 \cdot x\right)} \]
                    4. neg-sub0N/A

                      \[\leadsto \frac{\mathsf{neg}\left({x}^{3}\right)}{\color{blue}{0 \cdot 0} + \left(x \cdot x + 0 \cdot x\right)} \]
                    5. cube-negN/A

                      \[\leadsto \frac{{\left(\mathsf{neg}\left(x\right)\right)}^{3}}{\color{blue}{0 \cdot 0} + \left(x \cdot x + 0 \cdot x\right)} \]
                    6. sqr-powN/A

                      \[\leadsto \frac{{\left(\mathsf{neg}\left(x\right)\right)}^{\left(\frac{3}{2}\right)} \cdot {\left(\mathsf{neg}\left(x\right)\right)}^{\left(\frac{3}{2}\right)}}{\color{blue}{0 \cdot 0} + \left(x \cdot x + 0 \cdot x\right)} \]
                    7. unpow-prod-downN/A

                      \[\leadsto \frac{{\left(\left(\mathsf{neg}\left(x\right)\right) \cdot \left(\mathsf{neg}\left(x\right)\right)\right)}^{\left(\frac{3}{2}\right)}}{\color{blue}{0 \cdot 0} + \left(x \cdot x + 0 \cdot x\right)} \]
                    8. sqr-negN/A

                      \[\leadsto \frac{{\left(x \cdot x\right)}^{\left(\frac{3}{2}\right)}}{\color{blue}{0} \cdot 0 + \left(x \cdot x + 0 \cdot x\right)} \]
                    9. pow-prod-downN/A

                      \[\leadsto \frac{{x}^{\left(\frac{3}{2}\right)} \cdot {x}^{\left(\frac{3}{2}\right)}}{\color{blue}{0 \cdot 0} + \left(x \cdot x + 0 \cdot x\right)} \]
                    10. sqr-powN/A

                      \[\leadsto \frac{{x}^{3}}{\color{blue}{0 \cdot 0} + \left(x \cdot x + 0 \cdot x\right)} \]
                    11. metadata-evalN/A

                      \[\leadsto \frac{{x}^{3}}{0 + \left(\color{blue}{x \cdot x} + 0 \cdot x\right)} \]
                    12. +-lft-identityN/A

                      \[\leadsto \frac{{x}^{3}}{x \cdot x + \color{blue}{0 \cdot x}} \]
                    13. distribute-rgt-outN/A

                      \[\leadsto \frac{{x}^{3}}{x \cdot \color{blue}{\left(x + 0\right)}} \]
                    14. +-commutativeN/A

                      \[\leadsto \frac{{x}^{3}}{x \cdot \left(0 + \color{blue}{x}\right)} \]
                    15. +-lft-identityN/A

                      \[\leadsto \frac{{x}^{3}}{x \cdot x} \]
                    16. pow2N/A

                      \[\leadsto \frac{{x}^{3}}{{x}^{\color{blue}{2}}} \]
                    17. pow-divN/A

                      \[\leadsto {x}^{\color{blue}{\left(3 - 2\right)}} \]
                    18. metadata-evalN/A

                      \[\leadsto {x}^{1} \]
                    19. unpow12.7%

                      \[\leadsto x \]
                  11. Applied egg-rr2.7%

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

                  Reproduce

                  ?
                  herbie shell --seed 2024161 
                  (FPCore (x y)
                    :name "Data.Colour.SRGB:transferFunction from colour-2.3.3"
                    :precision binary64
                    (- (* (+ x 1.0) y) x))