Numeric.SpecFunctions:logGamma from math-functions-0.1.5.2, A

Percentage Accurate: 100.0% → 100.0%
Time: 12.0s
Alternatives: 14
Speedup: 1.0×

Specification

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

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

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

Alternative 1: 100.0% accurate, 1.0× speedup?

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

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

    \[\left(x \cdot \left(y - 1\right) - y \cdot 0.5\right) + 0.918938533204673 \]
  2. Final simplification100.0%

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

Alternative 2: 49.3% accurate, 0.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -0.5:\\ \;\;\;\;x \cdot y\\ \mathbf{elif}\;x \leq -3.2 \cdot 10^{-219}:\\ \;\;\;\;y \cdot -0.5\\ \mathbf{elif}\;x \leq -7.2 \cdot 10^{-247}:\\ \;\;\;\;0.918938533204673\\ \mathbf{elif}\;x \leq -1.18 \cdot 10^{-268}:\\ \;\;\;\;y \cdot -0.5\\ \mathbf{elif}\;x \leq 1.25 \cdot 10^{-144}:\\ \;\;\;\;0.918938533204673\\ \mathbf{elif}\;x \leq 0.65:\\ \;\;\;\;y \cdot -0.5\\ \mathbf{else}:\\ \;\;\;\;-x\\ \end{array} \end{array} \]
(FPCore (x y)
 :precision binary64
 (if (<= x -0.5)
   (* x y)
   (if (<= x -3.2e-219)
     (* y -0.5)
     (if (<= x -7.2e-247)
       0.918938533204673
       (if (<= x -1.18e-268)
         (* y -0.5)
         (if (<= x 1.25e-144)
           0.918938533204673
           (if (<= x 0.65) (* y -0.5) (- x))))))))
double code(double x, double y) {
	double tmp;
	if (x <= -0.5) {
		tmp = x * y;
	} else if (x <= -3.2e-219) {
		tmp = y * -0.5;
	} else if (x <= -7.2e-247) {
		tmp = 0.918938533204673;
	} else if (x <= -1.18e-268) {
		tmp = y * -0.5;
	} else if (x <= 1.25e-144) {
		tmp = 0.918938533204673;
	} else if (x <= 0.65) {
		tmp = y * -0.5;
	} else {
		tmp = -x;
	}
	return tmp;
}
real(8) function code(x, y)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8) :: tmp
    if (x <= (-0.5d0)) then
        tmp = x * y
    else if (x <= (-3.2d-219)) then
        tmp = y * (-0.5d0)
    else if (x <= (-7.2d-247)) then
        tmp = 0.918938533204673d0
    else if (x <= (-1.18d-268)) then
        tmp = y * (-0.5d0)
    else if (x <= 1.25d-144) then
        tmp = 0.918938533204673d0
    else if (x <= 0.65d0) then
        tmp = y * (-0.5d0)
    else
        tmp = -x
    end if
    code = tmp
end function
public static double code(double x, double y) {
	double tmp;
	if (x <= -0.5) {
		tmp = x * y;
	} else if (x <= -3.2e-219) {
		tmp = y * -0.5;
	} else if (x <= -7.2e-247) {
		tmp = 0.918938533204673;
	} else if (x <= -1.18e-268) {
		tmp = y * -0.5;
	} else if (x <= 1.25e-144) {
		tmp = 0.918938533204673;
	} else if (x <= 0.65) {
		tmp = y * -0.5;
	} else {
		tmp = -x;
	}
	return tmp;
}
def code(x, y):
	tmp = 0
	if x <= -0.5:
		tmp = x * y
	elif x <= -3.2e-219:
		tmp = y * -0.5
	elif x <= -7.2e-247:
		tmp = 0.918938533204673
	elif x <= -1.18e-268:
		tmp = y * -0.5
	elif x <= 1.25e-144:
		tmp = 0.918938533204673
	elif x <= 0.65:
		tmp = y * -0.5
	else:
		tmp = -x
	return tmp
function code(x, y)
	tmp = 0.0
	if (x <= -0.5)
		tmp = Float64(x * y);
	elseif (x <= -3.2e-219)
		tmp = Float64(y * -0.5);
	elseif (x <= -7.2e-247)
		tmp = 0.918938533204673;
	elseif (x <= -1.18e-268)
		tmp = Float64(y * -0.5);
	elseif (x <= 1.25e-144)
		tmp = 0.918938533204673;
	elseif (x <= 0.65)
		tmp = Float64(y * -0.5);
	else
		tmp = Float64(-x);
	end
	return tmp
end
function tmp_2 = code(x, y)
	tmp = 0.0;
	if (x <= -0.5)
		tmp = x * y;
	elseif (x <= -3.2e-219)
		tmp = y * -0.5;
	elseif (x <= -7.2e-247)
		tmp = 0.918938533204673;
	elseif (x <= -1.18e-268)
		tmp = y * -0.5;
	elseif (x <= 1.25e-144)
		tmp = 0.918938533204673;
	elseif (x <= 0.65)
		tmp = y * -0.5;
	else
		tmp = -x;
	end
	tmp_2 = tmp;
end
code[x_, y_] := If[LessEqual[x, -0.5], N[(x * y), $MachinePrecision], If[LessEqual[x, -3.2e-219], N[(y * -0.5), $MachinePrecision], If[LessEqual[x, -7.2e-247], 0.918938533204673, If[LessEqual[x, -1.18e-268], N[(y * -0.5), $MachinePrecision], If[LessEqual[x, 1.25e-144], 0.918938533204673, If[LessEqual[x, 0.65], N[(y * -0.5), $MachinePrecision], (-x)]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x \leq -0.5:\\
\;\;\;\;x \cdot y\\

\mathbf{elif}\;x \leq -3.2 \cdot 10^{-219}:\\
\;\;\;\;y \cdot -0.5\\

\mathbf{elif}\;x \leq -7.2 \cdot 10^{-247}:\\
\;\;\;\;0.918938533204673\\

\mathbf{elif}\;x \leq -1.18 \cdot 10^{-268}:\\
\;\;\;\;y \cdot -0.5\\

\mathbf{elif}\;x \leq 1.25 \cdot 10^{-144}:\\
\;\;\;\;0.918938533204673\\

\mathbf{elif}\;x \leq 0.65:\\
\;\;\;\;y \cdot -0.5\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if x < -0.5

    1. Initial program 100.0%

      \[\left(x \cdot \left(y - 1\right) - y \cdot 0.5\right) + 0.918938533204673 \]
    2. Step-by-step derivation
      1. associate-+l-100.0%

        \[\leadsto \color{blue}{x \cdot \left(y - 1\right) - \left(y \cdot 0.5 - 0.918938533204673\right)} \]
      2. sub-neg100.0%

        \[\leadsto x \cdot \color{blue}{\left(y + \left(-1\right)\right)} - \left(y \cdot 0.5 - 0.918938533204673\right) \]
      3. metadata-eval100.0%

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

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

      \[\leadsto \color{blue}{y \cdot \left(x - 0.5\right)} \]
    5. Taylor expanded in x around inf 55.1%

      \[\leadsto \color{blue}{x \cdot y} \]
    6. Step-by-step derivation
      1. *-commutative55.1%

        \[\leadsto \color{blue}{y \cdot x} \]
    7. Simplified55.1%

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

    if -0.5 < x < -3.19999999999999998e-219 or -7.1999999999999994e-247 < x < -1.18e-268 or 1.2499999999999999e-144 < x < 0.650000000000000022

    1. Initial program 99.9%

      \[\left(x \cdot \left(y - 1\right) - y \cdot 0.5\right) + 0.918938533204673 \]
    2. Step-by-step derivation
      1. associate-+l-99.9%

        \[\leadsto \color{blue}{x \cdot \left(y - 1\right) - \left(y \cdot 0.5 - 0.918938533204673\right)} \]
      2. sub-neg99.9%

        \[\leadsto x \cdot \color{blue}{\left(y + \left(-1\right)\right)} - \left(y \cdot 0.5 - 0.918938533204673\right) \]
      3. metadata-eval99.9%

        \[\leadsto x \cdot \left(y + \color{blue}{-1}\right) - \left(y \cdot 0.5 - 0.918938533204673\right) \]
    3. Simplified99.9%

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

      \[\leadsto \color{blue}{y \cdot \left(x - 0.5\right)} \]
    5. Taylor expanded in x around 0 61.6%

      \[\leadsto \color{blue}{-0.5 \cdot y} \]
    6. Step-by-step derivation
      1. *-commutative61.6%

        \[\leadsto \color{blue}{y \cdot -0.5} \]
    7. Simplified61.6%

      \[\leadsto \color{blue}{y \cdot -0.5} \]

    if -3.19999999999999998e-219 < x < -7.1999999999999994e-247 or -1.18e-268 < x < 1.2499999999999999e-144

    1. Initial program 100.0%

      \[\left(x \cdot \left(y - 1\right) - y \cdot 0.5\right) + 0.918938533204673 \]
    2. Step-by-step derivation
      1. associate-+l-100.0%

        \[\leadsto \color{blue}{x \cdot \left(y - 1\right) - \left(y \cdot 0.5 - 0.918938533204673\right)} \]
      2. sub-neg100.0%

        \[\leadsto x \cdot \color{blue}{\left(y + \left(-1\right)\right)} - \left(y \cdot 0.5 - 0.918938533204673\right) \]
      3. metadata-eval100.0%

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

      \[\leadsto \color{blue}{x \cdot \left(y + -1\right) - \left(y \cdot 0.5 - 0.918938533204673\right)} \]
    4. Taylor expanded in x around 0 100.0%

      \[\leadsto \color{blue}{0.918938533204673 - 0.5 \cdot y} \]
    5. Step-by-step derivation
      1. flip--86.3%

        \[\leadsto \color{blue}{\frac{0.918938533204673 \cdot 0.918938533204673 - \left(0.5 \cdot y\right) \cdot \left(0.5 \cdot y\right)}{0.918938533204673 + 0.5 \cdot y}} \]
      2. frac-2neg86.3%

        \[\leadsto \color{blue}{\frac{-\left(0.918938533204673 \cdot 0.918938533204673 - \left(0.5 \cdot y\right) \cdot \left(0.5 \cdot y\right)\right)}{-\left(0.918938533204673 + 0.5 \cdot y\right)}} \]
      3. metadata-eval86.3%

        \[\leadsto \frac{-\left(\color{blue}{0.8444480278083559} - \left(0.5 \cdot y\right) \cdot \left(0.5 \cdot y\right)\right)}{-\left(0.918938533204673 + 0.5 \cdot y\right)} \]
      4. swap-sqr86.3%

        \[\leadsto \frac{-\left(0.8444480278083559 - \color{blue}{\left(0.5 \cdot 0.5\right) \cdot \left(y \cdot y\right)}\right)}{-\left(0.918938533204673 + 0.5 \cdot y\right)} \]
      5. metadata-eval86.3%

        \[\leadsto \frac{-\left(0.8444480278083559 - \color{blue}{0.25} \cdot \left(y \cdot y\right)\right)}{-\left(0.918938533204673 + 0.5 \cdot y\right)} \]
      6. *-commutative86.3%

        \[\leadsto \frac{-\left(0.8444480278083559 - \color{blue}{\left(y \cdot y\right) \cdot 0.25}\right)}{-\left(0.918938533204673 + 0.5 \cdot y\right)} \]
      7. associate-*l*86.3%

        \[\leadsto \frac{-\left(0.8444480278083559 - \color{blue}{y \cdot \left(y \cdot 0.25\right)}\right)}{-\left(0.918938533204673 + 0.5 \cdot y\right)} \]
      8. *-commutative86.3%

        \[\leadsto \frac{-\left(0.8444480278083559 - y \cdot \left(y \cdot 0.25\right)\right)}{-\left(0.918938533204673 + \color{blue}{y \cdot 0.5}\right)} \]
      9. +-commutative86.3%

        \[\leadsto \frac{-\left(0.8444480278083559 - y \cdot \left(y \cdot 0.25\right)\right)}{-\color{blue}{\left(y \cdot 0.5 + 0.918938533204673\right)}} \]
      10. distribute-neg-in86.3%

        \[\leadsto \frac{-\left(0.8444480278083559 - y \cdot \left(y \cdot 0.25\right)\right)}{\color{blue}{\left(-y \cdot 0.5\right) + \left(-0.918938533204673\right)}} \]
      11. distribute-rgt-neg-in86.3%

        \[\leadsto \frac{-\left(0.8444480278083559 - y \cdot \left(y \cdot 0.25\right)\right)}{\color{blue}{y \cdot \left(-0.5\right)} + \left(-0.918938533204673\right)} \]
      12. metadata-eval86.3%

        \[\leadsto \frac{-\left(0.8444480278083559 - y \cdot \left(y \cdot 0.25\right)\right)}{y \cdot \color{blue}{-0.5} + \left(-0.918938533204673\right)} \]
      13. metadata-eval86.3%

        \[\leadsto \frac{-\left(0.8444480278083559 - y \cdot \left(y \cdot 0.25\right)\right)}{y \cdot -0.5 + \color{blue}{-0.918938533204673}} \]
    6. Applied egg-rr86.3%

      \[\leadsto \color{blue}{\frac{-\left(0.8444480278083559 - y \cdot \left(y \cdot 0.25\right)\right)}{y \cdot -0.5 + -0.918938533204673}} \]
    7. Taylor expanded in y around 0 68.6%

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

    if 0.650000000000000022 < x

    1. Initial program 100.0%

      \[\left(x \cdot \left(y - 1\right) - y \cdot 0.5\right) + 0.918938533204673 \]
    2. Step-by-step derivation
      1. cancel-sign-sub-inv100.0%

        \[\leadsto \color{blue}{\left(x \cdot \left(y - 1\right) + \left(-y\right) \cdot 0.5\right)} + 0.918938533204673 \]
      2. +-commutative100.0%

        \[\leadsto \color{blue}{\left(\left(-y\right) \cdot 0.5 + x \cdot \left(y - 1\right)\right)} + 0.918938533204673 \]
      3. distribute-lft-out--100.0%

        \[\leadsto \left(\left(-y\right) \cdot 0.5 + \color{blue}{\left(x \cdot y - x \cdot 1\right)}\right) + 0.918938533204673 \]
      4. cancel-sign-sub-inv100.0%

        \[\leadsto \left(\left(-y\right) \cdot 0.5 + \color{blue}{\left(x \cdot y + \left(-x\right) \cdot 1\right)}\right) + 0.918938533204673 \]
      5. *-rgt-identity100.0%

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

        \[\leadsto \color{blue}{\left(\left(\left(-y\right) \cdot 0.5 + x \cdot y\right) + \left(-x\right)\right)} + 0.918938533204673 \]
      7. associate-+l+100.0%

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

        \[\leadsto \left(\left(-y\right) \cdot 0.5 + x \cdot y\right) + \color{blue}{\left(0.918938533204673 + \left(-x\right)\right)} \]
      9. unsub-neg100.0%

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

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

        \[\leadsto \left(\left(\left(-y\right) \cdot 0.5 + \color{blue}{y \cdot x}\right) + 0.918938533204673\right) - x \]
      12. distribute-lft-neg-out100.0%

        \[\leadsto \left(\left(\color{blue}{\left(-y \cdot 0.5\right)} + y \cdot x\right) + 0.918938533204673\right) - x \]
      13. distribute-rgt-neg-in100.0%

        \[\leadsto \left(\left(\color{blue}{y \cdot \left(-0.5\right)} + y \cdot x\right) + 0.918938533204673\right) - x \]
      14. distribute-lft-out100.0%

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(y, \left(-0.5\right) + x, 0.918938533204673\right)} - x \]
      16. +-commutative100.0%

        \[\leadsto \mathsf{fma}\left(y, \color{blue}{x + \left(-0.5\right)}, 0.918938533204673\right) - x \]
      17. sub-neg100.0%

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(y, x - 0.5, 0.918938533204673\right) - x} \]
    4. Step-by-step derivation
      1. fma-udef100.0%

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

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

        \[\leadsto \left(y \cdot \color{blue}{\left(x - 0.5\right)} + 0.918938533204673\right) - x \]
      4. sub-neg100.0%

        \[\leadsto \left(y \cdot \color{blue}{\left(x + \left(-0.5\right)\right)} + 0.918938533204673\right) - x \]
      5. metadata-eval100.0%

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

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

      \[\leadsto \color{blue}{x \cdot y} - x \]
    7. Step-by-step derivation
      1. *-commutative96.8%

        \[\leadsto \color{blue}{y \cdot x} - x \]
    8. Simplified96.8%

      \[\leadsto \color{blue}{y \cdot x} - x \]
    9. Taylor expanded in y around 0 63.3%

      \[\leadsto \color{blue}{-1 \cdot x} \]
    10. Step-by-step derivation
      1. neg-mul-163.3%

        \[\leadsto \color{blue}{-x} \]
    11. Simplified63.3%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -0.5:\\ \;\;\;\;x \cdot y\\ \mathbf{elif}\;x \leq -3.2 \cdot 10^{-219}:\\ \;\;\;\;y \cdot -0.5\\ \mathbf{elif}\;x \leq -7.2 \cdot 10^{-247}:\\ \;\;\;\;0.918938533204673\\ \mathbf{elif}\;x \leq -1.18 \cdot 10^{-268}:\\ \;\;\;\;y \cdot -0.5\\ \mathbf{elif}\;x \leq 1.25 \cdot 10^{-144}:\\ \;\;\;\;0.918938533204673\\ \mathbf{elif}\;x \leq 0.65:\\ \;\;\;\;y \cdot -0.5\\ \mathbf{else}:\\ \;\;\;\;-x\\ \end{array} \]

Alternative 3: 49.7% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.45 \cdot 10^{-8}:\\
\;\;\;\;y \cdot -0.5\\

\mathbf{elif}\;y \leq -4.15 \cdot 10^{-277}:\\
\;\;\;\;0.918938533204673\\

\mathbf{elif}\;y \leq 3.6 \cdot 10^{-247}:\\
\;\;\;\;-x\\

\mathbf{elif}\;y \leq 1.3 \cdot 10^{-168}:\\
\;\;\;\;0.918938533204673\\

\mathbf{elif}\;y \leq 1.85:\\
\;\;\;\;-x\\

\mathbf{else}:\\
\;\;\;\;y \cdot -0.5\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -1.4500000000000001e-8 or 1.8500000000000001 < y

    1. Initial program 100.0%

      \[\left(x \cdot \left(y - 1\right) - y \cdot 0.5\right) + 0.918938533204673 \]
    2. Step-by-step derivation
      1. associate-+l-100.0%

        \[\leadsto \color{blue}{x \cdot \left(y - 1\right) - \left(y \cdot 0.5 - 0.918938533204673\right)} \]
      2. sub-neg100.0%

        \[\leadsto x \cdot \color{blue}{\left(y + \left(-1\right)\right)} - \left(y \cdot 0.5 - 0.918938533204673\right) \]
      3. metadata-eval100.0%

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

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

      \[\leadsto \color{blue}{y \cdot \left(x - 0.5\right)} \]
    5. Taylor expanded in x around 0 56.7%

      \[\leadsto \color{blue}{-0.5 \cdot y} \]
    6. Step-by-step derivation
      1. *-commutative56.7%

        \[\leadsto \color{blue}{y \cdot -0.5} \]
    7. Simplified56.7%

      \[\leadsto \color{blue}{y \cdot -0.5} \]

    if -1.4500000000000001e-8 < y < -4.14999999999999989e-277 or 3.5999999999999997e-247 < y < 1.3e-168

    1. Initial program 100.0%

      \[\left(x \cdot \left(y - 1\right) - y \cdot 0.5\right) + 0.918938533204673 \]
    2. Step-by-step derivation
      1. associate-+l-100.0%

        \[\leadsto \color{blue}{x \cdot \left(y - 1\right) - \left(y \cdot 0.5 - 0.918938533204673\right)} \]
      2. sub-neg100.0%

        \[\leadsto x \cdot \color{blue}{\left(y + \left(-1\right)\right)} - \left(y \cdot 0.5 - 0.918938533204673\right) \]
      3. metadata-eval100.0%

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

      \[\leadsto \color{blue}{x \cdot \left(y + -1\right) - \left(y \cdot 0.5 - 0.918938533204673\right)} \]
    4. Taylor expanded in x around 0 62.4%

      \[\leadsto \color{blue}{0.918938533204673 - 0.5 \cdot y} \]
    5. Step-by-step derivation
      1. flip--62.4%

        \[\leadsto \color{blue}{\frac{0.918938533204673 \cdot 0.918938533204673 - \left(0.5 \cdot y\right) \cdot \left(0.5 \cdot y\right)}{0.918938533204673 + 0.5 \cdot y}} \]
      2. frac-2neg62.4%

        \[\leadsto \color{blue}{\frac{-\left(0.918938533204673 \cdot 0.918938533204673 - \left(0.5 \cdot y\right) \cdot \left(0.5 \cdot y\right)\right)}{-\left(0.918938533204673 + 0.5 \cdot y\right)}} \]
      3. metadata-eval62.4%

        \[\leadsto \frac{-\left(\color{blue}{0.8444480278083559} - \left(0.5 \cdot y\right) \cdot \left(0.5 \cdot y\right)\right)}{-\left(0.918938533204673 + 0.5 \cdot y\right)} \]
      4. swap-sqr62.4%

        \[\leadsto \frac{-\left(0.8444480278083559 - \color{blue}{\left(0.5 \cdot 0.5\right) \cdot \left(y \cdot y\right)}\right)}{-\left(0.918938533204673 + 0.5 \cdot y\right)} \]
      5. metadata-eval62.4%

        \[\leadsto \frac{-\left(0.8444480278083559 - \color{blue}{0.25} \cdot \left(y \cdot y\right)\right)}{-\left(0.918938533204673 + 0.5 \cdot y\right)} \]
      6. *-commutative62.4%

        \[\leadsto \frac{-\left(0.8444480278083559 - \color{blue}{\left(y \cdot y\right) \cdot 0.25}\right)}{-\left(0.918938533204673 + 0.5 \cdot y\right)} \]
      7. associate-*l*62.4%

        \[\leadsto \frac{-\left(0.8444480278083559 - \color{blue}{y \cdot \left(y \cdot 0.25\right)}\right)}{-\left(0.918938533204673 + 0.5 \cdot y\right)} \]
      8. *-commutative62.4%

        \[\leadsto \frac{-\left(0.8444480278083559 - y \cdot \left(y \cdot 0.25\right)\right)}{-\left(0.918938533204673 + \color{blue}{y \cdot 0.5}\right)} \]
      9. +-commutative62.4%

        \[\leadsto \frac{-\left(0.8444480278083559 - y \cdot \left(y \cdot 0.25\right)\right)}{-\color{blue}{\left(y \cdot 0.5 + 0.918938533204673\right)}} \]
      10. distribute-neg-in62.4%

        \[\leadsto \frac{-\left(0.8444480278083559 - y \cdot \left(y \cdot 0.25\right)\right)}{\color{blue}{\left(-y \cdot 0.5\right) + \left(-0.918938533204673\right)}} \]
      11. distribute-rgt-neg-in62.4%

        \[\leadsto \frac{-\left(0.8444480278083559 - y \cdot \left(y \cdot 0.25\right)\right)}{\color{blue}{y \cdot \left(-0.5\right)} + \left(-0.918938533204673\right)} \]
      12. metadata-eval62.4%

        \[\leadsto \frac{-\left(0.8444480278083559 - y \cdot \left(y \cdot 0.25\right)\right)}{y \cdot \color{blue}{-0.5} + \left(-0.918938533204673\right)} \]
      13. metadata-eval62.4%

        \[\leadsto \frac{-\left(0.8444480278083559 - y \cdot \left(y \cdot 0.25\right)\right)}{y \cdot -0.5 + \color{blue}{-0.918938533204673}} \]
    6. Applied egg-rr62.4%

      \[\leadsto \color{blue}{\frac{-\left(0.8444480278083559 - y \cdot \left(y \cdot 0.25\right)\right)}{y \cdot -0.5 + -0.918938533204673}} \]
    7. Taylor expanded in y around 0 61.2%

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

    if -4.14999999999999989e-277 < y < 3.5999999999999997e-247 or 1.3e-168 < y < 1.8500000000000001

    1. Initial program 99.9%

      \[\left(x \cdot \left(y - 1\right) - y \cdot 0.5\right) + 0.918938533204673 \]
    2. Step-by-step derivation
      1. cancel-sign-sub-inv99.9%

        \[\leadsto \color{blue}{\left(x \cdot \left(y - 1\right) + \left(-y\right) \cdot 0.5\right)} + 0.918938533204673 \]
      2. +-commutative99.9%

        \[\leadsto \color{blue}{\left(\left(-y\right) \cdot 0.5 + x \cdot \left(y - 1\right)\right)} + 0.918938533204673 \]
      3. distribute-lft-out--99.9%

        \[\leadsto \left(\left(-y\right) \cdot 0.5 + \color{blue}{\left(x \cdot y - x \cdot 1\right)}\right) + 0.918938533204673 \]
      4. cancel-sign-sub-inv99.9%

        \[\leadsto \left(\left(-y\right) \cdot 0.5 + \color{blue}{\left(x \cdot y + \left(-x\right) \cdot 1\right)}\right) + 0.918938533204673 \]
      5. *-rgt-identity99.9%

        \[\leadsto \left(\left(-y\right) \cdot 0.5 + \left(x \cdot y + \color{blue}{\left(-x\right)}\right)\right) + 0.918938533204673 \]
      6. associate-+r+99.9%

        \[\leadsto \color{blue}{\left(\left(\left(-y\right) \cdot 0.5 + x \cdot y\right) + \left(-x\right)\right)} + 0.918938533204673 \]
      7. associate-+l+99.9%

        \[\leadsto \color{blue}{\left(\left(-y\right) \cdot 0.5 + x \cdot y\right) + \left(\left(-x\right) + 0.918938533204673\right)} \]
      8. +-commutative99.9%

        \[\leadsto \left(\left(-y\right) \cdot 0.5 + x \cdot y\right) + \color{blue}{\left(0.918938533204673 + \left(-x\right)\right)} \]
      9. unsub-neg99.9%

        \[\leadsto \left(\left(-y\right) \cdot 0.5 + x \cdot y\right) + \color{blue}{\left(0.918938533204673 - x\right)} \]
      10. associate-+r-99.9%

        \[\leadsto \color{blue}{\left(\left(\left(-y\right) \cdot 0.5 + x \cdot y\right) + 0.918938533204673\right) - x} \]
      11. *-commutative99.9%

        \[\leadsto \left(\left(\left(-y\right) \cdot 0.5 + \color{blue}{y \cdot x}\right) + 0.918938533204673\right) - x \]
      12. distribute-lft-neg-out99.9%

        \[\leadsto \left(\left(\color{blue}{\left(-y \cdot 0.5\right)} + y \cdot x\right) + 0.918938533204673\right) - x \]
      13. distribute-rgt-neg-in99.9%

        \[\leadsto \left(\left(\color{blue}{y \cdot \left(-0.5\right)} + y \cdot x\right) + 0.918938533204673\right) - x \]
      14. distribute-lft-out99.9%

        \[\leadsto \left(\color{blue}{y \cdot \left(\left(-0.5\right) + x\right)} + 0.918938533204673\right) - x \]
      15. fma-def99.9%

        \[\leadsto \color{blue}{\mathsf{fma}\left(y, \left(-0.5\right) + x, 0.918938533204673\right)} - x \]
      16. +-commutative99.9%

        \[\leadsto \mathsf{fma}\left(y, \color{blue}{x + \left(-0.5\right)}, 0.918938533204673\right) - x \]
      17. sub-neg99.9%

        \[\leadsto \mathsf{fma}\left(y, \color{blue}{x - 0.5}, 0.918938533204673\right) - x \]
    3. Simplified99.9%

      \[\leadsto \color{blue}{\mathsf{fma}\left(y, x - 0.5, 0.918938533204673\right) - x} \]
    4. Step-by-step derivation
      1. fma-udef99.9%

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

        \[\leadsto \left(y \cdot \color{blue}{\left(1 \cdot \left(x - 0.5\right)\right)} + 0.918938533204673\right) - x \]
      3. *-un-lft-identity99.9%

        \[\leadsto \left(y \cdot \color{blue}{\left(x - 0.5\right)} + 0.918938533204673\right) - x \]
      4. sub-neg99.9%

        \[\leadsto \left(y \cdot \color{blue}{\left(x + \left(-0.5\right)\right)} + 0.918938533204673\right) - x \]
      5. metadata-eval99.9%

        \[\leadsto \left(y \cdot \left(x + \color{blue}{-0.5}\right) + 0.918938533204673\right) - x \]
    5. Applied egg-rr99.9%

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

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

        \[\leadsto \color{blue}{y \cdot x} - x \]
    8. Simplified64.9%

      \[\leadsto \color{blue}{y \cdot x} - x \]
    9. Taylor expanded in y around 0 64.8%

      \[\leadsto \color{blue}{-1 \cdot x} \]
    10. Step-by-step derivation
      1. neg-mul-164.8%

        \[\leadsto \color{blue}{-x} \]
    11. Simplified64.8%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.45 \cdot 10^{-8}:\\ \;\;\;\;y \cdot -0.5\\ \mathbf{elif}\;y \leq -4.15 \cdot 10^{-277}:\\ \;\;\;\;0.918938533204673\\ \mathbf{elif}\;y \leq 3.6 \cdot 10^{-247}:\\ \;\;\;\;-x\\ \mathbf{elif}\;y \leq 1.3 \cdot 10^{-168}:\\ \;\;\;\;0.918938533204673\\ \mathbf{elif}\;y \leq 1.85:\\ \;\;\;\;-x\\ \mathbf{else}:\\ \;\;\;\;y \cdot -0.5\\ \end{array} \]

Alternative 4: 98.7% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -1350000:\\
\;\;\;\;y \cdot \left(x - 0.5\right) - x\\

\mathbf{elif}\;x \leq 4.4 \cdot 10^{-8}:\\
\;\;\;\;x \cdot y + \left(0.918938533204673 - y \cdot 0.5\right)\\

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


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

    1. Initial program 100.0%

      \[\left(x \cdot \left(y - 1\right) - y \cdot 0.5\right) + 0.918938533204673 \]
    2. Step-by-step derivation
      1. cancel-sign-sub-inv100.0%

        \[\leadsto \color{blue}{\left(x \cdot \left(y - 1\right) + \left(-y\right) \cdot 0.5\right)} + 0.918938533204673 \]
      2. +-commutative100.0%

        \[\leadsto \color{blue}{\left(\left(-y\right) \cdot 0.5 + x \cdot \left(y - 1\right)\right)} + 0.918938533204673 \]
      3. distribute-lft-out--100.0%

        \[\leadsto \left(\left(-y\right) \cdot 0.5 + \color{blue}{\left(x \cdot y - x \cdot 1\right)}\right) + 0.918938533204673 \]
      4. cancel-sign-sub-inv100.0%

        \[\leadsto \left(\left(-y\right) \cdot 0.5 + \color{blue}{\left(x \cdot y + \left(-x\right) \cdot 1\right)}\right) + 0.918938533204673 \]
      5. *-rgt-identity100.0%

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

        \[\leadsto \color{blue}{\left(\left(\left(-y\right) \cdot 0.5 + x \cdot y\right) + \left(-x\right)\right)} + 0.918938533204673 \]
      7. associate-+l+100.0%

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

        \[\leadsto \left(\left(-y\right) \cdot 0.5 + x \cdot y\right) + \color{blue}{\left(0.918938533204673 + \left(-x\right)\right)} \]
      9. unsub-neg100.0%

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

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

        \[\leadsto \left(\left(\left(-y\right) \cdot 0.5 + \color{blue}{y \cdot x}\right) + 0.918938533204673\right) - x \]
      12. distribute-lft-neg-out100.0%

        \[\leadsto \left(\left(\color{blue}{\left(-y \cdot 0.5\right)} + y \cdot x\right) + 0.918938533204673\right) - x \]
      13. distribute-rgt-neg-in100.0%

        \[\leadsto \left(\left(\color{blue}{y \cdot \left(-0.5\right)} + y \cdot x\right) + 0.918938533204673\right) - x \]
      14. distribute-lft-out100.0%

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(y, \left(-0.5\right) + x, 0.918938533204673\right)} - x \]
      16. +-commutative100.0%

        \[\leadsto \mathsf{fma}\left(y, \color{blue}{x + \left(-0.5\right)}, 0.918938533204673\right) - x \]
      17. sub-neg100.0%

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(y, x - 0.5, 0.918938533204673\right) - x} \]
    4. Step-by-step derivation
      1. fma-udef100.0%

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

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

        \[\leadsto \left(y \cdot \color{blue}{\left(x - 0.5\right)} + 0.918938533204673\right) - x \]
      4. sub-neg100.0%

        \[\leadsto \left(y \cdot \color{blue}{\left(x + \left(-0.5\right)\right)} + 0.918938533204673\right) - x \]
      5. metadata-eval100.0%

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

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

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

    if -1.35e6 < x < 4.3999999999999997e-8

    1. Initial program 99.9%

      \[\left(x \cdot \left(y - 1\right) - y \cdot 0.5\right) + 0.918938533204673 \]
    2. Step-by-step derivation
      1. associate-+l-99.9%

        \[\leadsto \color{blue}{x \cdot \left(y - 1\right) - \left(y \cdot 0.5 - 0.918938533204673\right)} \]
      2. sub-neg99.9%

        \[\leadsto x \cdot \color{blue}{\left(y + \left(-1\right)\right)} - \left(y \cdot 0.5 - 0.918938533204673\right) \]
      3. metadata-eval99.9%

        \[\leadsto x \cdot \left(y + \color{blue}{-1}\right) - \left(y \cdot 0.5 - 0.918938533204673\right) \]
    3. Simplified99.9%

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

      \[\leadsto \color{blue}{x \cdot y} - \left(y \cdot 0.5 - 0.918938533204673\right) \]
    5. Step-by-step derivation
      1. *-commutative99.6%

        \[\leadsto \color{blue}{y \cdot x} - \left(y \cdot 0.5 - 0.918938533204673\right) \]
    6. Simplified99.6%

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

    if 4.3999999999999997e-8 < x

    1. Initial program 100.0%

      \[\left(x \cdot \left(y - 1\right) - y \cdot 0.5\right) + 0.918938533204673 \]
    2. Step-by-step derivation
      1. associate-+l-100.0%

        \[\leadsto \color{blue}{x \cdot \left(y - 1\right) - \left(y \cdot 0.5 - 0.918938533204673\right)} \]
      2. sub-neg100.0%

        \[\leadsto x \cdot \color{blue}{\left(y + \left(-1\right)\right)} - \left(y \cdot 0.5 - 0.918938533204673\right) \]
      3. metadata-eval100.0%

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

      \[\leadsto \color{blue}{x \cdot \left(y + -1\right) - \left(y \cdot 0.5 - 0.918938533204673\right)} \]
    4. Taylor expanded in y around 0 99.7%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -1350000:\\ \;\;\;\;y \cdot \left(x - 0.5\right) - x\\ \mathbf{elif}\;x \leq 4.4 \cdot 10^{-8}:\\ \;\;\;\;x \cdot y + \left(0.918938533204673 - y \cdot 0.5\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(y + -1\right) - -0.918938533204673\\ \end{array} \]

Alternative 5: 98.4% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -2.1 \cdot 10^{-11} \lor \neg \left(y \leq 4.8 \cdot 10^{-20}\right):\\ \;\;\;\;0.918938533204673 + y \cdot \left(x + -0.5\right)\\ \mathbf{else}:\\ \;\;\;\;0.918938533204673 - x\\ \end{array} \end{array} \]
(FPCore (x y)
 :precision binary64
 (if (or (<= y -2.1e-11) (not (<= y 4.8e-20)))
   (+ 0.918938533204673 (* y (+ x -0.5)))
   (- 0.918938533204673 x)))
double code(double x, double y) {
	double tmp;
	if ((y <= -2.1e-11) || !(y <= 4.8e-20)) {
		tmp = 0.918938533204673 + (y * (x + -0.5));
	} else {
		tmp = 0.918938533204673 - x;
	}
	return tmp;
}
real(8) function code(x, y)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8) :: tmp
    if ((y <= (-2.1d-11)) .or. (.not. (y <= 4.8d-20))) then
        tmp = 0.918938533204673d0 + (y * (x + (-0.5d0)))
    else
        tmp = 0.918938533204673d0 - x
    end if
    code = tmp
end function
public static double code(double x, double y) {
	double tmp;
	if ((y <= -2.1e-11) || !(y <= 4.8e-20)) {
		tmp = 0.918938533204673 + (y * (x + -0.5));
	} else {
		tmp = 0.918938533204673 - x;
	}
	return tmp;
}
def code(x, y):
	tmp = 0
	if (y <= -2.1e-11) or not (y <= 4.8e-20):
		tmp = 0.918938533204673 + (y * (x + -0.5))
	else:
		tmp = 0.918938533204673 - x
	return tmp
function code(x, y)
	tmp = 0.0
	if ((y <= -2.1e-11) || !(y <= 4.8e-20))
		tmp = Float64(0.918938533204673 + Float64(y * Float64(x + -0.5)));
	else
		tmp = Float64(0.918938533204673 - x);
	end
	return tmp
end
function tmp_2 = code(x, y)
	tmp = 0.0;
	if ((y <= -2.1e-11) || ~((y <= 4.8e-20)))
		tmp = 0.918938533204673 + (y * (x + -0.5));
	else
		tmp = 0.918938533204673 - x;
	end
	tmp_2 = tmp;
end
code[x_, y_] := If[Or[LessEqual[y, -2.1e-11], N[Not[LessEqual[y, 4.8e-20]], $MachinePrecision]], N[(0.918938533204673 + N[(y * N[(x + -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.918938533204673 - x), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.1 \cdot 10^{-11} \lor \neg \left(y \leq 4.8 \cdot 10^{-20}\right):\\
\;\;\;\;0.918938533204673 + y \cdot \left(x + -0.5\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -2.0999999999999999e-11 or 4.79999999999999986e-20 < y

    1. Initial program 99.9%

      \[\left(x \cdot \left(y - 1\right) - y \cdot 0.5\right) + 0.918938533204673 \]
    2. Step-by-step derivation
      1. associate-+l-99.9%

        \[\leadsto \color{blue}{x \cdot \left(y - 1\right) - \left(y \cdot 0.5 - 0.918938533204673\right)} \]
      2. sub-neg99.9%

        \[\leadsto x \cdot \color{blue}{\left(y + \left(-1\right)\right)} - \left(y \cdot 0.5 - 0.918938533204673\right) \]
      3. metadata-eval99.9%

        \[\leadsto x \cdot \left(y + \color{blue}{-1}\right) - \left(y \cdot 0.5 - 0.918938533204673\right) \]
    3. Simplified99.9%

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

      \[\leadsto \color{blue}{x \cdot y} - \left(y \cdot 0.5 - 0.918938533204673\right) \]
    5. Step-by-step derivation
      1. *-commutative97.2%

        \[\leadsto \color{blue}{y \cdot x} - \left(y \cdot 0.5 - 0.918938533204673\right) \]
    6. Simplified97.2%

      \[\leadsto \color{blue}{y \cdot x} - \left(y \cdot 0.5 - 0.918938533204673\right) \]
    7. Step-by-step derivation
      1. associate--r-97.2%

        \[\leadsto \color{blue}{\left(y \cdot x - y \cdot 0.5\right) + 0.918938533204673} \]
      2. sub-neg97.2%

        \[\leadsto \color{blue}{\left(y \cdot x + \left(-y \cdot 0.5\right)\right)} + 0.918938533204673 \]
      3. distribute-rgt-neg-in97.2%

        \[\leadsto \left(y \cdot x + \color{blue}{y \cdot \left(-0.5\right)}\right) + 0.918938533204673 \]
      4. metadata-eval97.2%

        \[\leadsto \left(y \cdot x + y \cdot \color{blue}{-0.5}\right) + 0.918938533204673 \]
      5. distribute-lft-in97.2%

        \[\leadsto \color{blue}{y \cdot \left(x + -0.5\right)} + 0.918938533204673 \]
    8. Applied egg-rr97.2%

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

    if -2.0999999999999999e-11 < y < 4.79999999999999986e-20

    1. Initial program 100.0%

      \[\left(x \cdot \left(y - 1\right) - y \cdot 0.5\right) + 0.918938533204673 \]
    2. Step-by-step derivation
      1. associate-+l-100.0%

        \[\leadsto \color{blue}{x \cdot \left(y - 1\right) - \left(y \cdot 0.5 - 0.918938533204673\right)} \]
      2. sub-neg100.0%

        \[\leadsto x \cdot \color{blue}{\left(y + \left(-1\right)\right)} - \left(y \cdot 0.5 - 0.918938533204673\right) \]
      3. metadata-eval100.0%

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

      \[\leadsto \color{blue}{x \cdot \left(y + -1\right) - \left(y \cdot 0.5 - 0.918938533204673\right)} \]
    4. Taylor expanded in y around 0 100.0%

      \[\leadsto \color{blue}{0.918938533204673 + -1 \cdot x} \]
    5. Step-by-step derivation
      1. neg-mul-1100.0%

        \[\leadsto 0.918938533204673 + \color{blue}{\left(-x\right)} \]
      2. unsub-neg100.0%

        \[\leadsto \color{blue}{0.918938533204673 - x} \]
    6. Simplified100.0%

      \[\leadsto \color{blue}{0.918938533204673 - x} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification98.5%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -2.1 \cdot 10^{-11} \lor \neg \left(y \leq 4.8 \cdot 10^{-20}\right):\\ \;\;\;\;0.918938533204673 + y \cdot \left(x + -0.5\right)\\ \mathbf{else}:\\ \;\;\;\;0.918938533204673 - x\\ \end{array} \]

Alternative 6: 98.7% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -6400000 \lor \neg \left(x \leq 1.85 \cdot 10^{-8}\right):\\ \;\;\;\;x \cdot \left(y + -1\right) - -0.918938533204673\\ \mathbf{else}:\\ \;\;\;\;0.918938533204673 + y \cdot \left(x + -0.5\right)\\ \end{array} \end{array} \]
(FPCore (x y)
 :precision binary64
 (if (or (<= x -6400000.0) (not (<= x 1.85e-8)))
   (- (* x (+ y -1.0)) -0.918938533204673)
   (+ 0.918938533204673 (* y (+ x -0.5)))))
double code(double x, double y) {
	double tmp;
	if ((x <= -6400000.0) || !(x <= 1.85e-8)) {
		tmp = (x * (y + -1.0)) - -0.918938533204673;
	} else {
		tmp = 0.918938533204673 + (y * (x + -0.5));
	}
	return tmp;
}
real(8) function code(x, y)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8) :: tmp
    if ((x <= (-6400000.0d0)) .or. (.not. (x <= 1.85d-8))) then
        tmp = (x * (y + (-1.0d0))) - (-0.918938533204673d0)
    else
        tmp = 0.918938533204673d0 + (y * (x + (-0.5d0)))
    end if
    code = tmp
end function
public static double code(double x, double y) {
	double tmp;
	if ((x <= -6400000.0) || !(x <= 1.85e-8)) {
		tmp = (x * (y + -1.0)) - -0.918938533204673;
	} else {
		tmp = 0.918938533204673 + (y * (x + -0.5));
	}
	return tmp;
}
def code(x, y):
	tmp = 0
	if (x <= -6400000.0) or not (x <= 1.85e-8):
		tmp = (x * (y + -1.0)) - -0.918938533204673
	else:
		tmp = 0.918938533204673 + (y * (x + -0.5))
	return tmp
function code(x, y)
	tmp = 0.0
	if ((x <= -6400000.0) || !(x <= 1.85e-8))
		tmp = Float64(Float64(x * Float64(y + -1.0)) - -0.918938533204673);
	else
		tmp = Float64(0.918938533204673 + Float64(y * Float64(x + -0.5)));
	end
	return tmp
end
function tmp_2 = code(x, y)
	tmp = 0.0;
	if ((x <= -6400000.0) || ~((x <= 1.85e-8)))
		tmp = (x * (y + -1.0)) - -0.918938533204673;
	else
		tmp = 0.918938533204673 + (y * (x + -0.5));
	end
	tmp_2 = tmp;
end
code[x_, y_] := If[Or[LessEqual[x, -6400000.0], N[Not[LessEqual[x, 1.85e-8]], $MachinePrecision]], N[(N[(x * N[(y + -1.0), $MachinePrecision]), $MachinePrecision] - -0.918938533204673), $MachinePrecision], N[(0.918938533204673 + N[(y * N[(x + -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x \leq -6400000 \lor \neg \left(x \leq 1.85 \cdot 10^{-8}\right):\\
\;\;\;\;x \cdot \left(y + -1\right) - -0.918938533204673\\

\mathbf{else}:\\
\;\;\;\;0.918938533204673 + y \cdot \left(x + -0.5\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -6.4e6 or 1.85e-8 < x

    1. Initial program 100.0%

      \[\left(x \cdot \left(y - 1\right) - y \cdot 0.5\right) + 0.918938533204673 \]
    2. Step-by-step derivation
      1. associate-+l-100.0%

        \[\leadsto \color{blue}{x \cdot \left(y - 1\right) - \left(y \cdot 0.5 - 0.918938533204673\right)} \]
      2. sub-neg100.0%

        \[\leadsto x \cdot \color{blue}{\left(y + \left(-1\right)\right)} - \left(y \cdot 0.5 - 0.918938533204673\right) \]
      3. metadata-eval100.0%

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

      \[\leadsto \color{blue}{x \cdot \left(y + -1\right) - \left(y \cdot 0.5 - 0.918938533204673\right)} \]
    4. Taylor expanded in y around 0 99.3%

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

    if -6.4e6 < x < 1.85e-8

    1. Initial program 99.9%

      \[\left(x \cdot \left(y - 1\right) - y \cdot 0.5\right) + 0.918938533204673 \]
    2. Step-by-step derivation
      1. associate-+l-99.9%

        \[\leadsto \color{blue}{x \cdot \left(y - 1\right) - \left(y \cdot 0.5 - 0.918938533204673\right)} \]
      2. sub-neg99.9%

        \[\leadsto x \cdot \color{blue}{\left(y + \left(-1\right)\right)} - \left(y \cdot 0.5 - 0.918938533204673\right) \]
      3. metadata-eval99.9%

        \[\leadsto x \cdot \left(y + \color{blue}{-1}\right) - \left(y \cdot 0.5 - 0.918938533204673\right) \]
    3. Simplified99.9%

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

      \[\leadsto \color{blue}{x \cdot y} - \left(y \cdot 0.5 - 0.918938533204673\right) \]
    5. Step-by-step derivation
      1. *-commutative99.6%

        \[\leadsto \color{blue}{y \cdot x} - \left(y \cdot 0.5 - 0.918938533204673\right) \]
    6. Simplified99.6%

      \[\leadsto \color{blue}{y \cdot x} - \left(y \cdot 0.5 - 0.918938533204673\right) \]
    7. Step-by-step derivation
      1. associate--r-99.6%

        \[\leadsto \color{blue}{\left(y \cdot x - y \cdot 0.5\right) + 0.918938533204673} \]
      2. sub-neg99.6%

        \[\leadsto \color{blue}{\left(y \cdot x + \left(-y \cdot 0.5\right)\right)} + 0.918938533204673 \]
      3. distribute-rgt-neg-in99.6%

        \[\leadsto \left(y \cdot x + \color{blue}{y \cdot \left(-0.5\right)}\right) + 0.918938533204673 \]
      4. metadata-eval99.6%

        \[\leadsto \left(y \cdot x + y \cdot \color{blue}{-0.5}\right) + 0.918938533204673 \]
      5. distribute-lft-in99.6%

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

      \[\leadsto \color{blue}{y \cdot \left(x + -0.5\right) + 0.918938533204673} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification99.5%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -6400000 \lor \neg \left(x \leq 1.85 \cdot 10^{-8}\right):\\ \;\;\;\;x \cdot \left(y + -1\right) - -0.918938533204673\\ \mathbf{else}:\\ \;\;\;\;0.918938533204673 + y \cdot \left(x + -0.5\right)\\ \end{array} \]

Alternative 7: 98.7% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -1350000:\\
\;\;\;\;y \cdot \left(x - 0.5\right) - x\\

\mathbf{elif}\;x \leq 4.4 \cdot 10^{-8}:\\
\;\;\;\;0.918938533204673 + y \cdot \left(x + -0.5\right)\\

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


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

    1. Initial program 100.0%

      \[\left(x \cdot \left(y - 1\right) - y \cdot 0.5\right) + 0.918938533204673 \]
    2. Step-by-step derivation
      1. cancel-sign-sub-inv100.0%

        \[\leadsto \color{blue}{\left(x \cdot \left(y - 1\right) + \left(-y\right) \cdot 0.5\right)} + 0.918938533204673 \]
      2. +-commutative100.0%

        \[\leadsto \color{blue}{\left(\left(-y\right) \cdot 0.5 + x \cdot \left(y - 1\right)\right)} + 0.918938533204673 \]
      3. distribute-lft-out--100.0%

        \[\leadsto \left(\left(-y\right) \cdot 0.5 + \color{blue}{\left(x \cdot y - x \cdot 1\right)}\right) + 0.918938533204673 \]
      4. cancel-sign-sub-inv100.0%

        \[\leadsto \left(\left(-y\right) \cdot 0.5 + \color{blue}{\left(x \cdot y + \left(-x\right) \cdot 1\right)}\right) + 0.918938533204673 \]
      5. *-rgt-identity100.0%

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

        \[\leadsto \color{blue}{\left(\left(\left(-y\right) \cdot 0.5 + x \cdot y\right) + \left(-x\right)\right)} + 0.918938533204673 \]
      7. associate-+l+100.0%

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

        \[\leadsto \left(\left(-y\right) \cdot 0.5 + x \cdot y\right) + \color{blue}{\left(0.918938533204673 + \left(-x\right)\right)} \]
      9. unsub-neg100.0%

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

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

        \[\leadsto \left(\left(\left(-y\right) \cdot 0.5 + \color{blue}{y \cdot x}\right) + 0.918938533204673\right) - x \]
      12. distribute-lft-neg-out100.0%

        \[\leadsto \left(\left(\color{blue}{\left(-y \cdot 0.5\right)} + y \cdot x\right) + 0.918938533204673\right) - x \]
      13. distribute-rgt-neg-in100.0%

        \[\leadsto \left(\left(\color{blue}{y \cdot \left(-0.5\right)} + y \cdot x\right) + 0.918938533204673\right) - x \]
      14. distribute-lft-out100.0%

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(y, \left(-0.5\right) + x, 0.918938533204673\right)} - x \]
      16. +-commutative100.0%

        \[\leadsto \mathsf{fma}\left(y, \color{blue}{x + \left(-0.5\right)}, 0.918938533204673\right) - x \]
      17. sub-neg100.0%

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(y, x - 0.5, 0.918938533204673\right) - x} \]
    4. Step-by-step derivation
      1. fma-udef100.0%

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

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

        \[\leadsto \left(y \cdot \color{blue}{\left(x - 0.5\right)} + 0.918938533204673\right) - x \]
      4. sub-neg100.0%

        \[\leadsto \left(y \cdot \color{blue}{\left(x + \left(-0.5\right)\right)} + 0.918938533204673\right) - x \]
      5. metadata-eval100.0%

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

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

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

    if -1.35e6 < x < 4.3999999999999997e-8

    1. Initial program 99.9%

      \[\left(x \cdot \left(y - 1\right) - y \cdot 0.5\right) + 0.918938533204673 \]
    2. Step-by-step derivation
      1. associate-+l-99.9%

        \[\leadsto \color{blue}{x \cdot \left(y - 1\right) - \left(y \cdot 0.5 - 0.918938533204673\right)} \]
      2. sub-neg99.9%

        \[\leadsto x \cdot \color{blue}{\left(y + \left(-1\right)\right)} - \left(y \cdot 0.5 - 0.918938533204673\right) \]
      3. metadata-eval99.9%

        \[\leadsto x \cdot \left(y + \color{blue}{-1}\right) - \left(y \cdot 0.5 - 0.918938533204673\right) \]
    3. Simplified99.9%

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

      \[\leadsto \color{blue}{x \cdot y} - \left(y \cdot 0.5 - 0.918938533204673\right) \]
    5. Step-by-step derivation
      1. *-commutative99.6%

        \[\leadsto \color{blue}{y \cdot x} - \left(y \cdot 0.5 - 0.918938533204673\right) \]
    6. Simplified99.6%

      \[\leadsto \color{blue}{y \cdot x} - \left(y \cdot 0.5 - 0.918938533204673\right) \]
    7. Step-by-step derivation
      1. associate--r-99.6%

        \[\leadsto \color{blue}{\left(y \cdot x - y \cdot 0.5\right) + 0.918938533204673} \]
      2. sub-neg99.6%

        \[\leadsto \color{blue}{\left(y \cdot x + \left(-y \cdot 0.5\right)\right)} + 0.918938533204673 \]
      3. distribute-rgt-neg-in99.6%

        \[\leadsto \left(y \cdot x + \color{blue}{y \cdot \left(-0.5\right)}\right) + 0.918938533204673 \]
      4. metadata-eval99.6%

        \[\leadsto \left(y \cdot x + y \cdot \color{blue}{-0.5}\right) + 0.918938533204673 \]
      5. distribute-lft-in99.6%

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

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

    if 4.3999999999999997e-8 < x

    1. Initial program 100.0%

      \[\left(x \cdot \left(y - 1\right) - y \cdot 0.5\right) + 0.918938533204673 \]
    2. Step-by-step derivation
      1. associate-+l-100.0%

        \[\leadsto \color{blue}{x \cdot \left(y - 1\right) - \left(y \cdot 0.5 - 0.918938533204673\right)} \]
      2. sub-neg100.0%

        \[\leadsto x \cdot \color{blue}{\left(y + \left(-1\right)\right)} - \left(y \cdot 0.5 - 0.918938533204673\right) \]
      3. metadata-eval100.0%

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

      \[\leadsto \color{blue}{x \cdot \left(y + -1\right) - \left(y \cdot 0.5 - 0.918938533204673\right)} \]
    4. Taylor expanded in y around 0 99.7%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -1350000:\\ \;\;\;\;y \cdot \left(x - 0.5\right) - x\\ \mathbf{elif}\;x \leq 4.4 \cdot 10^{-8}:\\ \;\;\;\;0.918938533204673 + y \cdot \left(x + -0.5\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(y + -1\right) - -0.918938533204673\\ \end{array} \]

Alternative 8: 74.0% accurate, 1.2× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -19:\\
\;\;\;\;y \cdot -0.5\\

\mathbf{elif}\;y \leq 1.85:\\
\;\;\;\;0.918938533204673 - x\\

\mathbf{elif}\;y \leq 1.25 \cdot 10^{+134}:\\
\;\;\;\;x \cdot y\\

\mathbf{else}:\\
\;\;\;\;y \cdot -0.5\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -19 or 1.24999999999999995e134 < y

    1. Initial program 100.0%

      \[\left(x \cdot \left(y - 1\right) - y \cdot 0.5\right) + 0.918938533204673 \]
    2. Step-by-step derivation
      1. associate-+l-100.0%

        \[\leadsto \color{blue}{x \cdot \left(y - 1\right) - \left(y \cdot 0.5 - 0.918938533204673\right)} \]
      2. sub-neg100.0%

        \[\leadsto x \cdot \color{blue}{\left(y + \left(-1\right)\right)} - \left(y \cdot 0.5 - 0.918938533204673\right) \]
      3. metadata-eval100.0%

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

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

      \[\leadsto \color{blue}{y \cdot \left(x - 0.5\right)} \]
    5. Taylor expanded in x around 0 64.3%

      \[\leadsto \color{blue}{-0.5 \cdot y} \]
    6. Step-by-step derivation
      1. *-commutative64.3%

        \[\leadsto \color{blue}{y \cdot -0.5} \]
    7. Simplified64.3%

      \[\leadsto \color{blue}{y \cdot -0.5} \]

    if -19 < y < 1.8500000000000001

    1. Initial program 99.9%

      \[\left(x \cdot \left(y - 1\right) - y \cdot 0.5\right) + 0.918938533204673 \]
    2. Step-by-step derivation
      1. associate-+l-99.9%

        \[\leadsto \color{blue}{x \cdot \left(y - 1\right) - \left(y \cdot 0.5 - 0.918938533204673\right)} \]
      2. sub-neg99.9%

        \[\leadsto x \cdot \color{blue}{\left(y + \left(-1\right)\right)} - \left(y \cdot 0.5 - 0.918938533204673\right) \]
      3. metadata-eval99.9%

        \[\leadsto x \cdot \left(y + \color{blue}{-1}\right) - \left(y \cdot 0.5 - 0.918938533204673\right) \]
    3. Simplified99.9%

      \[\leadsto \color{blue}{x \cdot \left(y + -1\right) - \left(y \cdot 0.5 - 0.918938533204673\right)} \]
    4. Taylor expanded in y around 0 97.3%

      \[\leadsto \color{blue}{0.918938533204673 + -1 \cdot x} \]
    5. Step-by-step derivation
      1. neg-mul-197.3%

        \[\leadsto 0.918938533204673 + \color{blue}{\left(-x\right)} \]
      2. unsub-neg97.3%

        \[\leadsto \color{blue}{0.918938533204673 - x} \]
    6. Simplified97.3%

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

    if 1.8500000000000001 < y < 1.24999999999999995e134

    1. Initial program 100.0%

      \[\left(x \cdot \left(y - 1\right) - y \cdot 0.5\right) + 0.918938533204673 \]
    2. Step-by-step derivation
      1. associate-+l-100.0%

        \[\leadsto \color{blue}{x \cdot \left(y - 1\right) - \left(y \cdot 0.5 - 0.918938533204673\right)} \]
      2. sub-neg100.0%

        \[\leadsto x \cdot \color{blue}{\left(y + \left(-1\right)\right)} - \left(y \cdot 0.5 - 0.918938533204673\right) \]
      3. metadata-eval100.0%

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

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

      \[\leadsto \color{blue}{y \cdot \left(x - 0.5\right)} \]
    5. Taylor expanded in x around inf 54.5%

      \[\leadsto \color{blue}{x \cdot y} \]
    6. Step-by-step derivation
      1. *-commutative54.5%

        \[\leadsto \color{blue}{y \cdot x} \]
    7. Simplified54.5%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -19:\\ \;\;\;\;y \cdot -0.5\\ \mathbf{elif}\;y \leq 1.85:\\ \;\;\;\;0.918938533204673 - x\\ \mathbf{elif}\;y \leq 1.25 \cdot 10^{+134}:\\ \;\;\;\;x \cdot y\\ \mathbf{else}:\\ \;\;\;\;y \cdot -0.5\\ \end{array} \]

Alternative 9: 98.0% accurate, 1.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -1.45 \lor \neg \left(y \leq 1.85\right):\\ \;\;\;\;y \cdot \left(x - 0.5\right)\\ \mathbf{else}:\\ \;\;\;\;0.918938533204673 - x\\ \end{array} \end{array} \]
(FPCore (x y)
 :precision binary64
 (if (or (<= y -1.45) (not (<= y 1.85)))
   (* y (- x 0.5))
   (- 0.918938533204673 x)))
double code(double x, double y) {
	double tmp;
	if ((y <= -1.45) || !(y <= 1.85)) {
		tmp = y * (x - 0.5);
	} else {
		tmp = 0.918938533204673 - x;
	}
	return tmp;
}
real(8) function code(x, y)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8) :: tmp
    if ((y <= (-1.45d0)) .or. (.not. (y <= 1.85d0))) then
        tmp = y * (x - 0.5d0)
    else
        tmp = 0.918938533204673d0 - x
    end if
    code = tmp
end function
public static double code(double x, double y) {
	double tmp;
	if ((y <= -1.45) || !(y <= 1.85)) {
		tmp = y * (x - 0.5);
	} else {
		tmp = 0.918938533204673 - x;
	}
	return tmp;
}
def code(x, y):
	tmp = 0
	if (y <= -1.45) or not (y <= 1.85):
		tmp = y * (x - 0.5)
	else:
		tmp = 0.918938533204673 - x
	return tmp
function code(x, y)
	tmp = 0.0
	if ((y <= -1.45) || !(y <= 1.85))
		tmp = Float64(y * Float64(x - 0.5));
	else
		tmp = Float64(0.918938533204673 - x);
	end
	return tmp
end
function tmp_2 = code(x, y)
	tmp = 0.0;
	if ((y <= -1.45) || ~((y <= 1.85)))
		tmp = y * (x - 0.5);
	else
		tmp = 0.918938533204673 - x;
	end
	tmp_2 = tmp;
end
code[x_, y_] := If[Or[LessEqual[y, -1.45], N[Not[LessEqual[y, 1.85]], $MachinePrecision]], N[(y * N[(x - 0.5), $MachinePrecision]), $MachinePrecision], N[(0.918938533204673 - x), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.45 \lor \neg \left(y \leq 1.85\right):\\
\;\;\;\;y \cdot \left(x - 0.5\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -1.44999999999999996 or 1.8500000000000001 < y

    1. Initial program 100.0%

      \[\left(x \cdot \left(y - 1\right) - y \cdot 0.5\right) + 0.918938533204673 \]
    2. Step-by-step derivation
      1. associate-+l-100.0%

        \[\leadsto \color{blue}{x \cdot \left(y - 1\right) - \left(y \cdot 0.5 - 0.918938533204673\right)} \]
      2. sub-neg100.0%

        \[\leadsto x \cdot \color{blue}{\left(y + \left(-1\right)\right)} - \left(y \cdot 0.5 - 0.918938533204673\right) \]
      3. metadata-eval100.0%

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

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

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

    if -1.44999999999999996 < y < 1.8500000000000001

    1. Initial program 99.9%

      \[\left(x \cdot \left(y - 1\right) - y \cdot 0.5\right) + 0.918938533204673 \]
    2. Step-by-step derivation
      1. associate-+l-99.9%

        \[\leadsto \color{blue}{x \cdot \left(y - 1\right) - \left(y \cdot 0.5 - 0.918938533204673\right)} \]
      2. sub-neg99.9%

        \[\leadsto x \cdot \color{blue}{\left(y + \left(-1\right)\right)} - \left(y \cdot 0.5 - 0.918938533204673\right) \]
      3. metadata-eval99.9%

        \[\leadsto x \cdot \left(y + \color{blue}{-1}\right) - \left(y \cdot 0.5 - 0.918938533204673\right) \]
    3. Simplified99.9%

      \[\leadsto \color{blue}{x \cdot \left(y + -1\right) - \left(y \cdot 0.5 - 0.918938533204673\right)} \]
    4. Taylor expanded in y around 0 97.3%

      \[\leadsto \color{blue}{0.918938533204673 + -1 \cdot x} \]
    5. Step-by-step derivation
      1. neg-mul-197.3%

        \[\leadsto 0.918938533204673 + \color{blue}{\left(-x\right)} \]
      2. unsub-neg97.3%

        \[\leadsto \color{blue}{0.918938533204673 - x} \]
    6. Simplified97.3%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.45 \lor \neg \left(y \leq 1.85\right):\\ \;\;\;\;y \cdot \left(x - 0.5\right)\\ \mathbf{else}:\\ \;\;\;\;0.918938533204673 - x\\ \end{array} \]

Alternative 10: 97.9% accurate, 1.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -0.68 \lor \neg \left(x \leq 0.52\right):\\ \;\;\;\;x \cdot \left(y + -1\right)\\ \mathbf{else}:\\ \;\;\;\;0.918938533204673 - y \cdot 0.5\\ \end{array} \end{array} \]
(FPCore (x y)
 :precision binary64
 (if (or (<= x -0.68) (not (<= x 0.52)))
   (* x (+ y -1.0))
   (- 0.918938533204673 (* y 0.5))))
double code(double x, double y) {
	double tmp;
	if ((x <= -0.68) || !(x <= 0.52)) {
		tmp = x * (y + -1.0);
	} else {
		tmp = 0.918938533204673 - (y * 0.5);
	}
	return tmp;
}
real(8) function code(x, y)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8) :: tmp
    if ((x <= (-0.68d0)) .or. (.not. (x <= 0.52d0))) then
        tmp = x * (y + (-1.0d0))
    else
        tmp = 0.918938533204673d0 - (y * 0.5d0)
    end if
    code = tmp
end function
public static double code(double x, double y) {
	double tmp;
	if ((x <= -0.68) || !(x <= 0.52)) {
		tmp = x * (y + -1.0);
	} else {
		tmp = 0.918938533204673 - (y * 0.5);
	}
	return tmp;
}
def code(x, y):
	tmp = 0
	if (x <= -0.68) or not (x <= 0.52):
		tmp = x * (y + -1.0)
	else:
		tmp = 0.918938533204673 - (y * 0.5)
	return tmp
function code(x, y)
	tmp = 0.0
	if ((x <= -0.68) || !(x <= 0.52))
		tmp = Float64(x * Float64(y + -1.0));
	else
		tmp = Float64(0.918938533204673 - Float64(y * 0.5));
	end
	return tmp
end
function tmp_2 = code(x, y)
	tmp = 0.0;
	if ((x <= -0.68) || ~((x <= 0.52)))
		tmp = x * (y + -1.0);
	else
		tmp = 0.918938533204673 - (y * 0.5);
	end
	tmp_2 = tmp;
end
code[x_, y_] := If[Or[LessEqual[x, -0.68], N[Not[LessEqual[x, 0.52]], $MachinePrecision]], N[(x * N[(y + -1.0), $MachinePrecision]), $MachinePrecision], N[(0.918938533204673 - N[(y * 0.5), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

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

\mathbf{else}:\\
\;\;\;\;0.918938533204673 - y \cdot 0.5\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -0.680000000000000049 or 0.52000000000000002 < x

    1. Initial program 100.0%

      \[\left(x \cdot \left(y - 1\right) - y \cdot 0.5\right) + 0.918938533204673 \]
    2. Step-by-step derivation
      1. cancel-sign-sub-inv100.0%

        \[\leadsto \color{blue}{\left(x \cdot \left(y - 1\right) + \left(-y\right) \cdot 0.5\right)} + 0.918938533204673 \]
      2. +-commutative100.0%

        \[\leadsto \color{blue}{\left(\left(-y\right) \cdot 0.5 + x \cdot \left(y - 1\right)\right)} + 0.918938533204673 \]
      3. distribute-lft-out--100.0%

        \[\leadsto \left(\left(-y\right) \cdot 0.5 + \color{blue}{\left(x \cdot y - x \cdot 1\right)}\right) + 0.918938533204673 \]
      4. cancel-sign-sub-inv100.0%

        \[\leadsto \left(\left(-y\right) \cdot 0.5 + \color{blue}{\left(x \cdot y + \left(-x\right) \cdot 1\right)}\right) + 0.918938533204673 \]
      5. *-rgt-identity100.0%

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

        \[\leadsto \color{blue}{\left(\left(\left(-y\right) \cdot 0.5 + x \cdot y\right) + \left(-x\right)\right)} + 0.918938533204673 \]
      7. associate-+l+100.0%

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

        \[\leadsto \left(\left(-y\right) \cdot 0.5 + x \cdot y\right) + \color{blue}{\left(0.918938533204673 + \left(-x\right)\right)} \]
      9. unsub-neg100.0%

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

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

        \[\leadsto \left(\left(\left(-y\right) \cdot 0.5 + \color{blue}{y \cdot x}\right) + 0.918938533204673\right) - x \]
      12. distribute-lft-neg-out100.0%

        \[\leadsto \left(\left(\color{blue}{\left(-y \cdot 0.5\right)} + y \cdot x\right) + 0.918938533204673\right) - x \]
      13. distribute-rgt-neg-in100.0%

        \[\leadsto \left(\left(\color{blue}{y \cdot \left(-0.5\right)} + y \cdot x\right) + 0.918938533204673\right) - x \]
      14. distribute-lft-out100.0%

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(y, \left(-0.5\right) + x, 0.918938533204673\right)} - x \]
      16. +-commutative100.0%

        \[\leadsto \mathsf{fma}\left(y, \color{blue}{x + \left(-0.5\right)}, 0.918938533204673\right) - x \]
      17. sub-neg100.0%

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(y, x - 0.5, 0.918938533204673\right) - x} \]
    4. Step-by-step derivation
      1. fma-udef100.0%

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

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

        \[\leadsto \left(y \cdot \color{blue}{\left(x - 0.5\right)} + 0.918938533204673\right) - x \]
      4. sub-neg100.0%

        \[\leadsto \left(y \cdot \color{blue}{\left(x + \left(-0.5\right)\right)} + 0.918938533204673\right) - x \]
      5. metadata-eval100.0%

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

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

      \[\leadsto \color{blue}{x \cdot y} - x \]
    7. Step-by-step derivation
      1. *-commutative96.8%

        \[\leadsto \color{blue}{y \cdot x} - x \]
    8. Simplified96.8%

      \[\leadsto \color{blue}{y \cdot x} - x \]
    9. Step-by-step derivation
      1. sub-neg96.8%

        \[\leadsto \color{blue}{y \cdot x + \left(-x\right)} \]
      2. neg-mul-196.8%

        \[\leadsto y \cdot x + \color{blue}{-1 \cdot x} \]
      3. distribute-rgt-in96.8%

        \[\leadsto \color{blue}{x \cdot \left(y + -1\right)} \]
      4. *-commutative96.8%

        \[\leadsto \color{blue}{\left(y + -1\right) \cdot x} \]
    10. Applied egg-rr96.8%

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

    if -0.680000000000000049 < x < 0.52000000000000002

    1. Initial program 99.9%

      \[\left(x \cdot \left(y - 1\right) - y \cdot 0.5\right) + 0.918938533204673 \]
    2. Step-by-step derivation
      1. associate-+l-99.9%

        \[\leadsto \color{blue}{x \cdot \left(y - 1\right) - \left(y \cdot 0.5 - 0.918938533204673\right)} \]
      2. sub-neg99.9%

        \[\leadsto x \cdot \color{blue}{\left(y + \left(-1\right)\right)} - \left(y \cdot 0.5 - 0.918938533204673\right) \]
      3. metadata-eval99.9%

        \[\leadsto x \cdot \left(y + \color{blue}{-1}\right) - \left(y \cdot 0.5 - 0.918938533204673\right) \]
    3. Simplified99.9%

      \[\leadsto \color{blue}{x \cdot \left(y + -1\right) - \left(y \cdot 0.5 - 0.918938533204673\right)} \]
    4. Taylor expanded in x around 0 97.9%

      \[\leadsto \color{blue}{0.918938533204673 - 0.5 \cdot y} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification97.4%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -0.68 \lor \neg \left(x \leq 0.52\right):\\ \;\;\;\;x \cdot \left(y + -1\right)\\ \mathbf{else}:\\ \;\;\;\;0.918938533204673 - y \cdot 0.5\\ \end{array} \]

Alternative 11: 97.9% accurate, 1.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -0.75:\\ \;\;\;\;x \cdot \left(y + -1\right)\\ \mathbf{elif}\;x \leq 0.62:\\ \;\;\;\;0.918938533204673 - y \cdot 0.5\\ \mathbf{else}:\\ \;\;\;\;x \cdot y - x\\ \end{array} \end{array} \]
(FPCore (x y)
 :precision binary64
 (if (<= x -0.75)
   (* x (+ y -1.0))
   (if (<= x 0.62) (- 0.918938533204673 (* y 0.5)) (- (* x y) x))))
double code(double x, double y) {
	double tmp;
	if (x <= -0.75) {
		tmp = x * (y + -1.0);
	} else if (x <= 0.62) {
		tmp = 0.918938533204673 - (y * 0.5);
	} 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 <= (-0.75d0)) then
        tmp = x * (y + (-1.0d0))
    else if (x <= 0.62d0) then
        tmp = 0.918938533204673d0 - (y * 0.5d0)
    else
        tmp = (x * y) - x
    end if
    code = tmp
end function
public static double code(double x, double y) {
	double tmp;
	if (x <= -0.75) {
		tmp = x * (y + -1.0);
	} else if (x <= 0.62) {
		tmp = 0.918938533204673 - (y * 0.5);
	} else {
		tmp = (x * y) - x;
	}
	return tmp;
}
def code(x, y):
	tmp = 0
	if x <= -0.75:
		tmp = x * (y + -1.0)
	elif x <= 0.62:
		tmp = 0.918938533204673 - (y * 0.5)
	else:
		tmp = (x * y) - x
	return tmp
function code(x, y)
	tmp = 0.0
	if (x <= -0.75)
		tmp = Float64(x * Float64(y + -1.0));
	elseif (x <= 0.62)
		tmp = Float64(0.918938533204673 - Float64(y * 0.5));
	else
		tmp = Float64(Float64(x * y) - x);
	end
	return tmp
end
function tmp_2 = code(x, y)
	tmp = 0.0;
	if (x <= -0.75)
		tmp = x * (y + -1.0);
	elseif (x <= 0.62)
		tmp = 0.918938533204673 - (y * 0.5);
	else
		tmp = (x * y) - x;
	end
	tmp_2 = tmp;
end
code[x_, y_] := If[LessEqual[x, -0.75], N[(x * N[(y + -1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 0.62], N[(0.918938533204673 - N[(y * 0.5), $MachinePrecision]), $MachinePrecision], N[(N[(x * y), $MachinePrecision] - x), $MachinePrecision]]]
\begin{array}{l}

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

\mathbf{elif}\;x \leq 0.62:\\
\;\;\;\;0.918938533204673 - y \cdot 0.5\\

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


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

    1. Initial program 100.0%

      \[\left(x \cdot \left(y - 1\right) - y \cdot 0.5\right) + 0.918938533204673 \]
    2. Step-by-step derivation
      1. cancel-sign-sub-inv100.0%

        \[\leadsto \color{blue}{\left(x \cdot \left(y - 1\right) + \left(-y\right) \cdot 0.5\right)} + 0.918938533204673 \]
      2. +-commutative100.0%

        \[\leadsto \color{blue}{\left(\left(-y\right) \cdot 0.5 + x \cdot \left(y - 1\right)\right)} + 0.918938533204673 \]
      3. distribute-lft-out--100.0%

        \[\leadsto \left(\left(-y\right) \cdot 0.5 + \color{blue}{\left(x \cdot y - x \cdot 1\right)}\right) + 0.918938533204673 \]
      4. cancel-sign-sub-inv100.0%

        \[\leadsto \left(\left(-y\right) \cdot 0.5 + \color{blue}{\left(x \cdot y + \left(-x\right) \cdot 1\right)}\right) + 0.918938533204673 \]
      5. *-rgt-identity100.0%

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

        \[\leadsto \color{blue}{\left(\left(\left(-y\right) \cdot 0.5 + x \cdot y\right) + \left(-x\right)\right)} + 0.918938533204673 \]
      7. associate-+l+100.0%

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

        \[\leadsto \left(\left(-y\right) \cdot 0.5 + x \cdot y\right) + \color{blue}{\left(0.918938533204673 + \left(-x\right)\right)} \]
      9. unsub-neg100.0%

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

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

        \[\leadsto \left(\left(\left(-y\right) \cdot 0.5 + \color{blue}{y \cdot x}\right) + 0.918938533204673\right) - x \]
      12. distribute-lft-neg-out100.0%

        \[\leadsto \left(\left(\color{blue}{\left(-y \cdot 0.5\right)} + y \cdot x\right) + 0.918938533204673\right) - x \]
      13. distribute-rgt-neg-in100.0%

        \[\leadsto \left(\left(\color{blue}{y \cdot \left(-0.5\right)} + y \cdot x\right) + 0.918938533204673\right) - x \]
      14. distribute-lft-out100.0%

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(y, \left(-0.5\right) + x, 0.918938533204673\right)} - x \]
      16. +-commutative100.0%

        \[\leadsto \mathsf{fma}\left(y, \color{blue}{x + \left(-0.5\right)}, 0.918938533204673\right) - x \]
      17. sub-neg100.0%

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(y, x - 0.5, 0.918938533204673\right) - x} \]
    4. Step-by-step derivation
      1. fma-udef100.0%

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

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

        \[\leadsto \left(y \cdot \color{blue}{\left(x - 0.5\right)} + 0.918938533204673\right) - x \]
      4. sub-neg100.0%

        \[\leadsto \left(y \cdot \color{blue}{\left(x + \left(-0.5\right)\right)} + 0.918938533204673\right) - x \]
      5. metadata-eval100.0%

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

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

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

        \[\leadsto \color{blue}{y \cdot x} - x \]
    8. Simplified96.9%

      \[\leadsto \color{blue}{y \cdot x} - x \]
    9. Step-by-step derivation
      1. sub-neg96.9%

        \[\leadsto \color{blue}{y \cdot x + \left(-x\right)} \]
      2. neg-mul-196.9%

        \[\leadsto y \cdot x + \color{blue}{-1 \cdot x} \]
      3. distribute-rgt-in96.9%

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

        \[\leadsto \color{blue}{\left(y + -1\right) \cdot x} \]
    10. Applied egg-rr96.9%

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

    if -0.75 < x < 0.619999999999999996

    1. Initial program 99.9%

      \[\left(x \cdot \left(y - 1\right) - y \cdot 0.5\right) + 0.918938533204673 \]
    2. Step-by-step derivation
      1. associate-+l-99.9%

        \[\leadsto \color{blue}{x \cdot \left(y - 1\right) - \left(y \cdot 0.5 - 0.918938533204673\right)} \]
      2. sub-neg99.9%

        \[\leadsto x \cdot \color{blue}{\left(y + \left(-1\right)\right)} - \left(y \cdot 0.5 - 0.918938533204673\right) \]
      3. metadata-eval99.9%

        \[\leadsto x \cdot \left(y + \color{blue}{-1}\right) - \left(y \cdot 0.5 - 0.918938533204673\right) \]
    3. Simplified99.9%

      \[\leadsto \color{blue}{x \cdot \left(y + -1\right) - \left(y \cdot 0.5 - 0.918938533204673\right)} \]
    4. Taylor expanded in x around 0 97.9%

      \[\leadsto \color{blue}{0.918938533204673 - 0.5 \cdot y} \]

    if 0.619999999999999996 < x

    1. Initial program 100.0%

      \[\left(x \cdot \left(y - 1\right) - y \cdot 0.5\right) + 0.918938533204673 \]
    2. Step-by-step derivation
      1. cancel-sign-sub-inv100.0%

        \[\leadsto \color{blue}{\left(x \cdot \left(y - 1\right) + \left(-y\right) \cdot 0.5\right)} + 0.918938533204673 \]
      2. +-commutative100.0%

        \[\leadsto \color{blue}{\left(\left(-y\right) \cdot 0.5 + x \cdot \left(y - 1\right)\right)} + 0.918938533204673 \]
      3. distribute-lft-out--100.0%

        \[\leadsto \left(\left(-y\right) \cdot 0.5 + \color{blue}{\left(x \cdot y - x \cdot 1\right)}\right) + 0.918938533204673 \]
      4. cancel-sign-sub-inv100.0%

        \[\leadsto \left(\left(-y\right) \cdot 0.5 + \color{blue}{\left(x \cdot y + \left(-x\right) \cdot 1\right)}\right) + 0.918938533204673 \]
      5. *-rgt-identity100.0%

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

        \[\leadsto \color{blue}{\left(\left(\left(-y\right) \cdot 0.5 + x \cdot y\right) + \left(-x\right)\right)} + 0.918938533204673 \]
      7. associate-+l+100.0%

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

        \[\leadsto \left(\left(-y\right) \cdot 0.5 + x \cdot y\right) + \color{blue}{\left(0.918938533204673 + \left(-x\right)\right)} \]
      9. unsub-neg100.0%

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

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

        \[\leadsto \left(\left(\left(-y\right) \cdot 0.5 + \color{blue}{y \cdot x}\right) + 0.918938533204673\right) - x \]
      12. distribute-lft-neg-out100.0%

        \[\leadsto \left(\left(\color{blue}{\left(-y \cdot 0.5\right)} + y \cdot x\right) + 0.918938533204673\right) - x \]
      13. distribute-rgt-neg-in100.0%

        \[\leadsto \left(\left(\color{blue}{y \cdot \left(-0.5\right)} + y \cdot x\right) + 0.918938533204673\right) - x \]
      14. distribute-lft-out100.0%

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(y, \left(-0.5\right) + x, 0.918938533204673\right)} - x \]
      16. +-commutative100.0%

        \[\leadsto \mathsf{fma}\left(y, \color{blue}{x + \left(-0.5\right)}, 0.918938533204673\right) - x \]
      17. sub-neg100.0%

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(y, x - 0.5, 0.918938533204673\right) - x} \]
    4. Step-by-step derivation
      1. fma-udef100.0%

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

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

        \[\leadsto \left(y \cdot \color{blue}{\left(x - 0.5\right)} + 0.918938533204673\right) - x \]
      4. sub-neg100.0%

        \[\leadsto \left(y \cdot \color{blue}{\left(x + \left(-0.5\right)\right)} + 0.918938533204673\right) - x \]
      5. metadata-eval100.0%

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

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

      \[\leadsto \color{blue}{x \cdot y} - x \]
    7. Step-by-step derivation
      1. *-commutative96.8%

        \[\leadsto \color{blue}{y \cdot x} - x \]
    8. Simplified96.8%

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

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

Alternative 12: 100.0% accurate, 1.2× speedup?

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

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

    \[\left(x \cdot \left(y - 1\right) - y \cdot 0.5\right) + 0.918938533204673 \]
  2. Step-by-step derivation
    1. cancel-sign-sub-inv100.0%

      \[\leadsto \color{blue}{\left(x \cdot \left(y - 1\right) + \left(-y\right) \cdot 0.5\right)} + 0.918938533204673 \]
    2. +-commutative100.0%

      \[\leadsto \color{blue}{\left(\left(-y\right) \cdot 0.5 + x \cdot \left(y - 1\right)\right)} + 0.918938533204673 \]
    3. distribute-lft-out--100.0%

      \[\leadsto \left(\left(-y\right) \cdot 0.5 + \color{blue}{\left(x \cdot y - x \cdot 1\right)}\right) + 0.918938533204673 \]
    4. cancel-sign-sub-inv100.0%

      \[\leadsto \left(\left(-y\right) \cdot 0.5 + \color{blue}{\left(x \cdot y + \left(-x\right) \cdot 1\right)}\right) + 0.918938533204673 \]
    5. *-rgt-identity100.0%

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

      \[\leadsto \color{blue}{\left(\left(\left(-y\right) \cdot 0.5 + x \cdot y\right) + \left(-x\right)\right)} + 0.918938533204673 \]
    7. associate-+l+100.0%

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

      \[\leadsto \left(\left(-y\right) \cdot 0.5 + x \cdot y\right) + \color{blue}{\left(0.918938533204673 + \left(-x\right)\right)} \]
    9. unsub-neg100.0%

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

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

      \[\leadsto \left(\left(\left(-y\right) \cdot 0.5 + \color{blue}{y \cdot x}\right) + 0.918938533204673\right) - x \]
    12. distribute-lft-neg-out100.0%

      \[\leadsto \left(\left(\color{blue}{\left(-y \cdot 0.5\right)} + y \cdot x\right) + 0.918938533204673\right) - x \]
    13. distribute-rgt-neg-in100.0%

      \[\leadsto \left(\left(\color{blue}{y \cdot \left(-0.5\right)} + y \cdot x\right) + 0.918938533204673\right) - x \]
    14. distribute-lft-out100.0%

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(y, \left(-0.5\right) + x, 0.918938533204673\right)} - x \]
    16. +-commutative100.0%

      \[\leadsto \mathsf{fma}\left(y, \color{blue}{x + \left(-0.5\right)}, 0.918938533204673\right) - x \]
    17. sub-neg100.0%

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

    \[\leadsto \color{blue}{\mathsf{fma}\left(y, x - 0.5, 0.918938533204673\right) - x} \]
  4. Step-by-step derivation
    1. fma-udef100.0%

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

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

      \[\leadsto \left(y \cdot \color{blue}{\left(x - 0.5\right)} + 0.918938533204673\right) - x \]
    4. sub-neg100.0%

      \[\leadsto \left(y \cdot \color{blue}{\left(x + \left(-0.5\right)\right)} + 0.918938533204673\right) - x \]
    5. metadata-eval100.0%

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

    \[\leadsto \color{blue}{\left(y \cdot \left(x + -0.5\right) + 0.918938533204673\right)} - x \]
  6. Final simplification100.0%

    \[\leadsto \left(0.918938533204673 + y \cdot \left(x + -0.5\right)\right) - x \]

Alternative 13: 49.8% accurate, 1.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -0.00355:\\ \;\;\;\;-x\\ \mathbf{elif}\;x \leq 0.92:\\ \;\;\;\;0.918938533204673\\ \mathbf{else}:\\ \;\;\;\;-x\\ \end{array} \end{array} \]
(FPCore (x y)
 :precision binary64
 (if (<= x -0.00355) (- x) (if (<= x 0.92) 0.918938533204673 (- x))))
double code(double x, double y) {
	double tmp;
	if (x <= -0.00355) {
		tmp = -x;
	} else if (x <= 0.92) {
		tmp = 0.918938533204673;
	} else {
		tmp = -x;
	}
	return tmp;
}
real(8) function code(x, y)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8) :: tmp
    if (x <= (-0.00355d0)) then
        tmp = -x
    else if (x <= 0.92d0) then
        tmp = 0.918938533204673d0
    else
        tmp = -x
    end if
    code = tmp
end function
public static double code(double x, double y) {
	double tmp;
	if (x <= -0.00355) {
		tmp = -x;
	} else if (x <= 0.92) {
		tmp = 0.918938533204673;
	} else {
		tmp = -x;
	}
	return tmp;
}
def code(x, y):
	tmp = 0
	if x <= -0.00355:
		tmp = -x
	elif x <= 0.92:
		tmp = 0.918938533204673
	else:
		tmp = -x
	return tmp
function code(x, y)
	tmp = 0.0
	if (x <= -0.00355)
		tmp = Float64(-x);
	elseif (x <= 0.92)
		tmp = 0.918938533204673;
	else
		tmp = Float64(-x);
	end
	return tmp
end
function tmp_2 = code(x, y)
	tmp = 0.0;
	if (x <= -0.00355)
		tmp = -x;
	elseif (x <= 0.92)
		tmp = 0.918938533204673;
	else
		tmp = -x;
	end
	tmp_2 = tmp;
end
code[x_, y_] := If[LessEqual[x, -0.00355], (-x), If[LessEqual[x, 0.92], 0.918938533204673, (-x)]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x \leq -0.00355:\\
\;\;\;\;-x\\

\mathbf{elif}\;x \leq 0.92:\\
\;\;\;\;0.918938533204673\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -0.0035500000000000002 or 0.92000000000000004 < x

    1. Initial program 100.0%

      \[\left(x \cdot \left(y - 1\right) - y \cdot 0.5\right) + 0.918938533204673 \]
    2. Step-by-step derivation
      1. cancel-sign-sub-inv100.0%

        \[\leadsto \color{blue}{\left(x \cdot \left(y - 1\right) + \left(-y\right) \cdot 0.5\right)} + 0.918938533204673 \]
      2. +-commutative100.0%

        \[\leadsto \color{blue}{\left(\left(-y\right) \cdot 0.5 + x \cdot \left(y - 1\right)\right)} + 0.918938533204673 \]
      3. distribute-lft-out--100.0%

        \[\leadsto \left(\left(-y\right) \cdot 0.5 + \color{blue}{\left(x \cdot y - x \cdot 1\right)}\right) + 0.918938533204673 \]
      4. cancel-sign-sub-inv100.0%

        \[\leadsto \left(\left(-y\right) \cdot 0.5 + \color{blue}{\left(x \cdot y + \left(-x\right) \cdot 1\right)}\right) + 0.918938533204673 \]
      5. *-rgt-identity100.0%

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

        \[\leadsto \color{blue}{\left(\left(\left(-y\right) \cdot 0.5 + x \cdot y\right) + \left(-x\right)\right)} + 0.918938533204673 \]
      7. associate-+l+100.0%

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

        \[\leadsto \left(\left(-y\right) \cdot 0.5 + x \cdot y\right) + \color{blue}{\left(0.918938533204673 + \left(-x\right)\right)} \]
      9. unsub-neg100.0%

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

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

        \[\leadsto \left(\left(\left(-y\right) \cdot 0.5 + \color{blue}{y \cdot x}\right) + 0.918938533204673\right) - x \]
      12. distribute-lft-neg-out100.0%

        \[\leadsto \left(\left(\color{blue}{\left(-y \cdot 0.5\right)} + y \cdot x\right) + 0.918938533204673\right) - x \]
      13. distribute-rgt-neg-in100.0%

        \[\leadsto \left(\left(\color{blue}{y \cdot \left(-0.5\right)} + y \cdot x\right) + 0.918938533204673\right) - x \]
      14. distribute-lft-out100.0%

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(y, \left(-0.5\right) + x, 0.918938533204673\right)} - x \]
      16. +-commutative100.0%

        \[\leadsto \mathsf{fma}\left(y, \color{blue}{x + \left(-0.5\right)}, 0.918938533204673\right) - x \]
      17. sub-neg100.0%

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(y, x - 0.5, 0.918938533204673\right) - x} \]
    4. Step-by-step derivation
      1. fma-udef100.0%

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

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

        \[\leadsto \left(y \cdot \color{blue}{\left(x - 0.5\right)} + 0.918938533204673\right) - x \]
      4. sub-neg100.0%

        \[\leadsto \left(y \cdot \color{blue}{\left(x + \left(-0.5\right)\right)} + 0.918938533204673\right) - x \]
      5. metadata-eval100.0%

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

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

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

        \[\leadsto \color{blue}{y \cdot x} - x \]
    8. Simplified96.1%

      \[\leadsto \color{blue}{y \cdot x} - x \]
    9. Taylor expanded in y around 0 53.8%

      \[\leadsto \color{blue}{-1 \cdot x} \]
    10. Step-by-step derivation
      1. neg-mul-153.8%

        \[\leadsto \color{blue}{-x} \]
    11. Simplified53.8%

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

    if -0.0035500000000000002 < x < 0.92000000000000004

    1. Initial program 99.9%

      \[\left(x \cdot \left(y - 1\right) - y \cdot 0.5\right) + 0.918938533204673 \]
    2. Step-by-step derivation
      1. associate-+l-99.9%

        \[\leadsto \color{blue}{x \cdot \left(y - 1\right) - \left(y \cdot 0.5 - 0.918938533204673\right)} \]
      2. sub-neg99.9%

        \[\leadsto x \cdot \color{blue}{\left(y + \left(-1\right)\right)} - \left(y \cdot 0.5 - 0.918938533204673\right) \]
      3. metadata-eval99.9%

        \[\leadsto x \cdot \left(y + \color{blue}{-1}\right) - \left(y \cdot 0.5 - 0.918938533204673\right) \]
    3. Simplified99.9%

      \[\leadsto \color{blue}{x \cdot \left(y + -1\right) - \left(y \cdot 0.5 - 0.918938533204673\right)} \]
    4. Taylor expanded in x around 0 98.4%

      \[\leadsto \color{blue}{0.918938533204673 - 0.5 \cdot y} \]
    5. Step-by-step derivation
      1. flip--73.2%

        \[\leadsto \color{blue}{\frac{0.918938533204673 \cdot 0.918938533204673 - \left(0.5 \cdot y\right) \cdot \left(0.5 \cdot y\right)}{0.918938533204673 + 0.5 \cdot y}} \]
      2. frac-2neg73.2%

        \[\leadsto \color{blue}{\frac{-\left(0.918938533204673 \cdot 0.918938533204673 - \left(0.5 \cdot y\right) \cdot \left(0.5 \cdot y\right)\right)}{-\left(0.918938533204673 + 0.5 \cdot y\right)}} \]
      3. metadata-eval73.2%

        \[\leadsto \frac{-\left(\color{blue}{0.8444480278083559} - \left(0.5 \cdot y\right) \cdot \left(0.5 \cdot y\right)\right)}{-\left(0.918938533204673 + 0.5 \cdot y\right)} \]
      4. swap-sqr73.2%

        \[\leadsto \frac{-\left(0.8444480278083559 - \color{blue}{\left(0.5 \cdot 0.5\right) \cdot \left(y \cdot y\right)}\right)}{-\left(0.918938533204673 + 0.5 \cdot y\right)} \]
      5. metadata-eval73.2%

        \[\leadsto \frac{-\left(0.8444480278083559 - \color{blue}{0.25} \cdot \left(y \cdot y\right)\right)}{-\left(0.918938533204673 + 0.5 \cdot y\right)} \]
      6. *-commutative73.2%

        \[\leadsto \frac{-\left(0.8444480278083559 - \color{blue}{\left(y \cdot y\right) \cdot 0.25}\right)}{-\left(0.918938533204673 + 0.5 \cdot y\right)} \]
      7. associate-*l*73.2%

        \[\leadsto \frac{-\left(0.8444480278083559 - \color{blue}{y \cdot \left(y \cdot 0.25\right)}\right)}{-\left(0.918938533204673 + 0.5 \cdot y\right)} \]
      8. *-commutative73.2%

        \[\leadsto \frac{-\left(0.8444480278083559 - y \cdot \left(y \cdot 0.25\right)\right)}{-\left(0.918938533204673 + \color{blue}{y \cdot 0.5}\right)} \]
      9. +-commutative73.2%

        \[\leadsto \frac{-\left(0.8444480278083559 - y \cdot \left(y \cdot 0.25\right)\right)}{-\color{blue}{\left(y \cdot 0.5 + 0.918938533204673\right)}} \]
      10. distribute-neg-in73.2%

        \[\leadsto \frac{-\left(0.8444480278083559 - y \cdot \left(y \cdot 0.25\right)\right)}{\color{blue}{\left(-y \cdot 0.5\right) + \left(-0.918938533204673\right)}} \]
      11. distribute-rgt-neg-in73.2%

        \[\leadsto \frac{-\left(0.8444480278083559 - y \cdot \left(y \cdot 0.25\right)\right)}{\color{blue}{y \cdot \left(-0.5\right)} + \left(-0.918938533204673\right)} \]
      12. metadata-eval73.2%

        \[\leadsto \frac{-\left(0.8444480278083559 - y \cdot \left(y \cdot 0.25\right)\right)}{y \cdot \color{blue}{-0.5} + \left(-0.918938533204673\right)} \]
      13. metadata-eval73.2%

        \[\leadsto \frac{-\left(0.8444480278083559 - y \cdot \left(y \cdot 0.25\right)\right)}{y \cdot -0.5 + \color{blue}{-0.918938533204673}} \]
    6. Applied egg-rr73.2%

      \[\leadsto \color{blue}{\frac{-\left(0.8444480278083559 - y \cdot \left(y \cdot 0.25\right)\right)}{y \cdot -0.5 + -0.918938533204673}} \]
    7. Taylor expanded in y around 0 47.5%

      \[\leadsto \color{blue}{0.918938533204673} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification50.4%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -0.00355:\\ \;\;\;\;-x\\ \mathbf{elif}\;x \leq 0.92:\\ \;\;\;\;0.918938533204673\\ \mathbf{else}:\\ \;\;\;\;-x\\ \end{array} \]

Alternative 14: 25.9% accurate, 11.0× speedup?

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

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

    \[\left(x \cdot \left(y - 1\right) - y \cdot 0.5\right) + 0.918938533204673 \]
  2. Step-by-step derivation
    1. associate-+l-100.0%

      \[\leadsto \color{blue}{x \cdot \left(y - 1\right) - \left(y \cdot 0.5 - 0.918938533204673\right)} \]
    2. sub-neg100.0%

      \[\leadsto x \cdot \color{blue}{\left(y + \left(-1\right)\right)} - \left(y \cdot 0.5 - 0.918938533204673\right) \]
    3. metadata-eval100.0%

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

    \[\leadsto \color{blue}{x \cdot \left(y + -1\right) - \left(y \cdot 0.5 - 0.918938533204673\right)} \]
  4. Taylor expanded in x around 0 55.2%

    \[\leadsto \color{blue}{0.918938533204673 - 0.5 \cdot y} \]
  5. Step-by-step derivation
    1. flip--43.2%

      \[\leadsto \color{blue}{\frac{0.918938533204673 \cdot 0.918938533204673 - \left(0.5 \cdot y\right) \cdot \left(0.5 \cdot y\right)}{0.918938533204673 + 0.5 \cdot y}} \]
    2. frac-2neg43.2%

      \[\leadsto \color{blue}{\frac{-\left(0.918938533204673 \cdot 0.918938533204673 - \left(0.5 \cdot y\right) \cdot \left(0.5 \cdot y\right)\right)}{-\left(0.918938533204673 + 0.5 \cdot y\right)}} \]
    3. metadata-eval43.2%

      \[\leadsto \frac{-\left(\color{blue}{0.8444480278083559} - \left(0.5 \cdot y\right) \cdot \left(0.5 \cdot y\right)\right)}{-\left(0.918938533204673 + 0.5 \cdot y\right)} \]
    4. swap-sqr43.2%

      \[\leadsto \frac{-\left(0.8444480278083559 - \color{blue}{\left(0.5 \cdot 0.5\right) \cdot \left(y \cdot y\right)}\right)}{-\left(0.918938533204673 + 0.5 \cdot y\right)} \]
    5. metadata-eval43.2%

      \[\leadsto \frac{-\left(0.8444480278083559 - \color{blue}{0.25} \cdot \left(y \cdot y\right)\right)}{-\left(0.918938533204673 + 0.5 \cdot y\right)} \]
    6. *-commutative43.2%

      \[\leadsto \frac{-\left(0.8444480278083559 - \color{blue}{\left(y \cdot y\right) \cdot 0.25}\right)}{-\left(0.918938533204673 + 0.5 \cdot y\right)} \]
    7. associate-*l*43.2%

      \[\leadsto \frac{-\left(0.8444480278083559 - \color{blue}{y \cdot \left(y \cdot 0.25\right)}\right)}{-\left(0.918938533204673 + 0.5 \cdot y\right)} \]
    8. *-commutative43.2%

      \[\leadsto \frac{-\left(0.8444480278083559 - y \cdot \left(y \cdot 0.25\right)\right)}{-\left(0.918938533204673 + \color{blue}{y \cdot 0.5}\right)} \]
    9. +-commutative43.2%

      \[\leadsto \frac{-\left(0.8444480278083559 - y \cdot \left(y \cdot 0.25\right)\right)}{-\color{blue}{\left(y \cdot 0.5 + 0.918938533204673\right)}} \]
    10. distribute-neg-in43.2%

      \[\leadsto \frac{-\left(0.8444480278083559 - y \cdot \left(y \cdot 0.25\right)\right)}{\color{blue}{\left(-y \cdot 0.5\right) + \left(-0.918938533204673\right)}} \]
    11. distribute-rgt-neg-in43.2%

      \[\leadsto \frac{-\left(0.8444480278083559 - y \cdot \left(y \cdot 0.25\right)\right)}{\color{blue}{y \cdot \left(-0.5\right)} + \left(-0.918938533204673\right)} \]
    12. metadata-eval43.2%

      \[\leadsto \frac{-\left(0.8444480278083559 - y \cdot \left(y \cdot 0.25\right)\right)}{y \cdot \color{blue}{-0.5} + \left(-0.918938533204673\right)} \]
    13. metadata-eval43.2%

      \[\leadsto \frac{-\left(0.8444480278083559 - y \cdot \left(y \cdot 0.25\right)\right)}{y \cdot -0.5 + \color{blue}{-0.918938533204673}} \]
  6. Applied egg-rr43.2%

    \[\leadsto \color{blue}{\frac{-\left(0.8444480278083559 - y \cdot \left(y \cdot 0.25\right)\right)}{y \cdot -0.5 + -0.918938533204673}} \]
  7. Taylor expanded in y around 0 26.9%

    \[\leadsto \color{blue}{0.918938533204673} \]
  8. Final simplification26.9%

    \[\leadsto 0.918938533204673 \]

Reproduce

?
herbie shell --seed 2023275 
(FPCore (x y)
  :name "Numeric.SpecFunctions:logGamma from math-functions-0.1.5.2, A"
  :precision binary64
  (+ (- (* x (- y 1.0)) (* y 0.5)) 0.918938533204673))