Data.Random.Distribution.Normal:normalF from random-fu-0.2.6.2

Percentage Accurate: 100.0% → 100.0%
Time: 18.8s
Alternatives: 11
Speedup: 1.0×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

The average percentage accuracy by input value. Horizontal axis shows value of an input variable; the variable is choosen in the title. Vertical axis is accuracy; higher is better. Red represent the original program, while blue represents Herbie's suggestion. These can be toggled with buttons below the plot. The line is an average while dots represent individual samples.

Accuracy vs Speed?

Herbie found 11 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} \\ e^{\left(x \cdot y\right) \cdot y} \end{array} \]
(FPCore (x y) :precision binary64 (exp (* (* x y) y)))
double code(double x, double y) {
	return exp(((x * y) * y));
}
real(8) function code(x, y)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    code = exp(((x * y) * y))
end function
public static double code(double x, double y) {
	return Math.exp(((x * y) * y));
}
def code(x, y):
	return math.exp(((x * y) * y))
function code(x, y)
	return exp(Float64(Float64(x * y) * y))
end
function tmp = code(x, y)
	tmp = exp(((x * y) * y));
end
code[x_, y_] := N[Exp[N[(N[(x * y), $MachinePrecision] * y), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}

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

Alternative 1: 100.0% accurate, 1.0× speedup?

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

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

    \[e^{\left(x \cdot y\right) \cdot y} \]
  2. Add Preprocessing
  3. Final simplification100.0%

    \[\leadsto e^{y \cdot \left(x \cdot y\right)} \]
  4. Add Preprocessing

Alternative 2: 92.8% accurate, 2.8× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 (*.f64 x y) y) < -2e7

    1. Initial program 100.0%

      \[e^{\left(x \cdot y\right) \cdot y} \]
    2. Add Preprocessing
    3. Taylor expanded in x around 0

      \[\leadsto \color{blue}{1 + x \cdot \left(x \cdot \left(\frac{1}{6} \cdot \left(x \cdot {y}^{6}\right) + \frac{1}{2} \cdot {y}^{4}\right) + {y}^{2}\right)} \]
    4. Simplified1.7%

      \[\leadsto \color{blue}{1 + \left(x \cdot \left(y \cdot y\right)\right) \cdot \left(1 + \left(x \cdot \left(y \cdot y\right)\right) \cdot \left(0.5 + \left(x \cdot \left(y \cdot y\right)\right) \cdot 0.16666666666666666\right)\right)} \]
    5. Step-by-step derivation
      1. flip-+N/A

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

        \[\leadsto \mathsf{/.f64}\left(\left(1 \cdot 1 - \left(\left(x \cdot \left(y \cdot y\right)\right) \cdot \left(1 + \left(x \cdot \left(y \cdot y\right)\right) \cdot \left(\frac{1}{2} + \left(x \cdot \left(y \cdot y\right)\right) \cdot \frac{1}{6}\right)\right)\right) \cdot \left(\left(x \cdot \left(y \cdot y\right)\right) \cdot \left(1 + \left(x \cdot \left(y \cdot y\right)\right) \cdot \left(\frac{1}{2} + \left(x \cdot \left(y \cdot y\right)\right) \cdot \frac{1}{6}\right)\right)\right)\right), \color{blue}{\left(1 - \left(x \cdot \left(y \cdot y\right)\right) \cdot \left(1 + \left(x \cdot \left(y \cdot y\right)\right) \cdot \left(\frac{1}{2} + \left(x \cdot \left(y \cdot y\right)\right) \cdot \frac{1}{6}\right)\right)\right)}\right) \]
    6. Applied egg-rr0.3%

      \[\leadsto \color{blue}{\frac{1 - \left(1 + \left(x \cdot \left(y \cdot y\right)\right) \cdot \left(0.5 + x \cdot \left(\left(y \cdot y\right) \cdot 0.16666666666666666\right)\right)\right) \cdot \left(\left(x \cdot \left(y \cdot y\right)\right) \cdot \left(x \cdot \left(\left(y \cdot y\right) \cdot \left(1 + \left(x \cdot \left(y \cdot y\right)\right) \cdot \left(0.5 + x \cdot \left(\left(y \cdot y\right) \cdot 0.16666666666666666\right)\right)\right)\right)\right)\right)}{1 - x \cdot \left(\left(y \cdot y\right) \cdot \left(1 + \left(x \cdot \left(y \cdot y\right)\right) \cdot \left(0.5 + x \cdot \left(\left(y \cdot y\right) \cdot 0.16666666666666666\right)\right)\right)\right)}} \]
    7. Taylor expanded in x around 0

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

        \[\leadsto \frac{\color{blue}{1}}{1 - x \cdot \left(\left(y \cdot y\right) \cdot \left(1 + \left(x \cdot \left(y \cdot y\right)\right) \cdot \left(0.5 + x \cdot \left(\left(y \cdot y\right) \cdot 0.16666666666666666\right)\right)\right)\right)} \]
      2. Step-by-step derivation
        1. distribute-rgt-inN/A

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

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

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

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

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

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

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

          \[\leadsto \mathsf{/.f64}\left(1, \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\mathsf{*.f64}\left(y, y\right), \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(\left(\left(y \cdot y\right) \cdot \left(\frac{1}{2} + x \cdot \left(\left(y \cdot y\right) \cdot \frac{1}{6}\right)\right)\right), \color{blue}{\left(y \cdot y\right)}\right)\right)\right)\right)\right)\right) \]
      3. Applied egg-rr95.5%

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

      if -2e7 < (*.f64 (*.f64 x y) y)

      1. Initial program 100.0%

        \[e^{\left(x \cdot y\right) \cdot y} \]
      2. Add Preprocessing
      3. Taylor expanded in x around 0

        \[\leadsto \color{blue}{1 + x \cdot \left(x \cdot \left(\frac{1}{6} \cdot \left(x \cdot {y}^{6}\right) + \frac{1}{2} \cdot {y}^{4}\right) + {y}^{2}\right)} \]
      4. Simplified96.0%

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

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

          \[\leadsto \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, \mathsf{*.f64}\left(y, y\right)\right), \mathsf{+.f64}\left(1, \left(\left({x}^{2} \cdot {y}^{4}\right) \cdot \color{blue}{\frac{1}{6}}\right)\right)\right)\right) \]
        2. unpow2N/A

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

          \[\leadsto \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, \mathsf{*.f64}\left(y, y\right)\right), \mathsf{+.f64}\left(1, \left(\left(x \cdot \left(x \cdot {y}^{4}\right)\right) \cdot \frac{1}{6}\right)\right)\right)\right) \]
        4. associate-*r*N/A

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

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

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

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

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

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

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

          \[\leadsto \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, \mathsf{*.f64}\left(y, y\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(\frac{1}{6}, \color{blue}{\left({y}^{4}\right)}\right)\right)\right)\right)\right)\right) \]
        12. metadata-evalN/A

          \[\leadsto \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, \mathsf{*.f64}\left(y, y\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(\frac{1}{6}, \left({y}^{\left(2 \cdot \color{blue}{2}\right)}\right)\right)\right)\right)\right)\right)\right) \]
        13. pow-sqrN/A

          \[\leadsto \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, \mathsf{*.f64}\left(y, y\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(\frac{1}{6}, \left({y}^{2} \cdot \color{blue}{{y}^{2}}\right)\right)\right)\right)\right)\right)\right) \]
        14. unpow2N/A

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

          \[\leadsto \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, \mathsf{*.f64}\left(y, y\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(\frac{1}{6}, \left(y \cdot \color{blue}{\left(y \cdot {y}^{2}\right)}\right)\right)\right)\right)\right)\right)\right) \]
        16. unpow2N/A

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

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

          \[\leadsto \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, \mathsf{*.f64}\left(y, y\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(\frac{1}{6}, \mathsf{*.f64}\left(y, \color{blue}{\left({y}^{3}\right)}\right)\right)\right)\right)\right)\right)\right) \]
        19. cube-multN/A

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

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

          \[\leadsto \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, \mathsf{*.f64}\left(y, y\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(\frac{1}{6}, \mathsf{*.f64}\left(y, \mathsf{*.f64}\left(y, \color{blue}{\left({y}^{2}\right)}\right)\right)\right)\right)\right)\right)\right)\right) \]
        22. unpow2N/A

          \[\leadsto \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, \mathsf{*.f64}\left(y, y\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(\frac{1}{6}, \mathsf{*.f64}\left(y, \mathsf{*.f64}\left(y, \left(y \cdot \color{blue}{y}\right)\right)\right)\right)\right)\right)\right)\right)\right) \]
        23. *-lowering-*.f6497.9%

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

        \[\leadsto 1 + \left(x \cdot \left(y \cdot y\right)\right) \cdot \left(1 + \color{blue}{x \cdot \left(x \cdot \left(0.16666666666666666 \cdot \left(y \cdot \left(y \cdot \left(y \cdot y\right)\right)\right)\right)\right)}\right) \]
    9. Recombined 2 regimes into one program.
    10. Final simplification97.3%

      \[\leadsto \begin{array}{l} \mathbf{if}\;y \cdot \left(x \cdot y\right) \leq -20000000:\\ \;\;\;\;\frac{1}{1 - x \cdot \left(y \cdot y + x \cdot \left(\left(y \cdot y\right) \cdot \left(y \cdot \left(y \cdot \left(0.5 + y \cdot \left(\left(x \cdot y\right) \cdot 0.16666666666666666\right)\right)\right)\right)\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;1 + \left(x \cdot \left(y \cdot y\right)\right) \cdot \left(1 + x \cdot \left(x \cdot \left(0.16666666666666666 \cdot \left(y \cdot \left(y \cdot \left(y \cdot y\right)\right)\right)\right)\right)\right)\\ \end{array} \]
    11. Add Preprocessing

    Alternative 3: 92.4% accurate, 2.9× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} t_0 := x \cdot \left(y \cdot y\right)\\ \mathbf{if}\;y \cdot \left(x \cdot y\right) \leq -20000000:\\ \;\;\;\;\frac{1}{1 + x \cdot \left(\left(y \cdot y\right) \cdot \left(-1 - t\_0 \cdot \left(0.5 + x \cdot \left(\left(y \cdot y\right) \cdot 0.16666666666666666\right)\right)\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;1 + t\_0 \cdot \left(1 + x \cdot \left(x \cdot \left(0.16666666666666666 \cdot \left(y \cdot \left(y \cdot \left(y \cdot y\right)\right)\right)\right)\right)\right)\\ \end{array} \end{array} \]
    (FPCore (x y)
     :precision binary64
     (let* ((t_0 (* x (* y y))))
       (if (<= (* y (* x y)) -20000000.0)
         (/
          1.0
          (+
           1.0
           (*
            x
            (*
             (* y y)
             (- -1.0 (* t_0 (+ 0.5 (* x (* (* y y) 0.16666666666666666)))))))))
         (+
          1.0
          (*
           t_0
           (+ 1.0 (* x (* x (* 0.16666666666666666 (* y (* y (* y y))))))))))))
    double code(double x, double y) {
    	double t_0 = x * (y * y);
    	double tmp;
    	if ((y * (x * y)) <= -20000000.0) {
    		tmp = 1.0 / (1.0 + (x * ((y * y) * (-1.0 - (t_0 * (0.5 + (x * ((y * y) * 0.16666666666666666))))))));
    	} else {
    		tmp = 1.0 + (t_0 * (1.0 + (x * (x * (0.16666666666666666 * (y * (y * (y * y))))))));
    	}
    	return tmp;
    }
    
    real(8) function code(x, y)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        real(8) :: t_0
        real(8) :: tmp
        t_0 = x * (y * y)
        if ((y * (x * y)) <= (-20000000.0d0)) then
            tmp = 1.0d0 / (1.0d0 + (x * ((y * y) * ((-1.0d0) - (t_0 * (0.5d0 + (x * ((y * y) * 0.16666666666666666d0))))))))
        else
            tmp = 1.0d0 + (t_0 * (1.0d0 + (x * (x * (0.16666666666666666d0 * (y * (y * (y * y))))))))
        end if
        code = tmp
    end function
    
    public static double code(double x, double y) {
    	double t_0 = x * (y * y);
    	double tmp;
    	if ((y * (x * y)) <= -20000000.0) {
    		tmp = 1.0 / (1.0 + (x * ((y * y) * (-1.0 - (t_0 * (0.5 + (x * ((y * y) * 0.16666666666666666))))))));
    	} else {
    		tmp = 1.0 + (t_0 * (1.0 + (x * (x * (0.16666666666666666 * (y * (y * (y * y))))))));
    	}
    	return tmp;
    }
    
    def code(x, y):
    	t_0 = x * (y * y)
    	tmp = 0
    	if (y * (x * y)) <= -20000000.0:
    		tmp = 1.0 / (1.0 + (x * ((y * y) * (-1.0 - (t_0 * (0.5 + (x * ((y * y) * 0.16666666666666666))))))))
    	else:
    		tmp = 1.0 + (t_0 * (1.0 + (x * (x * (0.16666666666666666 * (y * (y * (y * y))))))))
    	return tmp
    
    function code(x, y)
    	t_0 = Float64(x * Float64(y * y))
    	tmp = 0.0
    	if (Float64(y * Float64(x * y)) <= -20000000.0)
    		tmp = Float64(1.0 / Float64(1.0 + Float64(x * Float64(Float64(y * y) * Float64(-1.0 - Float64(t_0 * Float64(0.5 + Float64(x * Float64(Float64(y * y) * 0.16666666666666666)))))))));
    	else
    		tmp = Float64(1.0 + Float64(t_0 * Float64(1.0 + Float64(x * Float64(x * Float64(0.16666666666666666 * Float64(y * Float64(y * Float64(y * y)))))))));
    	end
    	return tmp
    end
    
    function tmp_2 = code(x, y)
    	t_0 = x * (y * y);
    	tmp = 0.0;
    	if ((y * (x * y)) <= -20000000.0)
    		tmp = 1.0 / (1.0 + (x * ((y * y) * (-1.0 - (t_0 * (0.5 + (x * ((y * y) * 0.16666666666666666))))))));
    	else
    		tmp = 1.0 + (t_0 * (1.0 + (x * (x * (0.16666666666666666 * (y * (y * (y * y))))))));
    	end
    	tmp_2 = tmp;
    end
    
    code[x_, y_] := Block[{t$95$0 = N[(x * N[(y * y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(y * N[(x * y), $MachinePrecision]), $MachinePrecision], -20000000.0], N[(1.0 / N[(1.0 + N[(x * N[(N[(y * y), $MachinePrecision] * N[(-1.0 - N[(t$95$0 * N[(0.5 + N[(x * N[(N[(y * y), $MachinePrecision] * 0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(t$95$0 * N[(1.0 + N[(x * N[(x * N[(0.16666666666666666 * N[(y * N[(y * N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    t_0 := x \cdot \left(y \cdot y\right)\\
    \mathbf{if}\;y \cdot \left(x \cdot y\right) \leq -20000000:\\
    \;\;\;\;\frac{1}{1 + x \cdot \left(\left(y \cdot y\right) \cdot \left(-1 - t\_0 \cdot \left(0.5 + x \cdot \left(\left(y \cdot y\right) \cdot 0.16666666666666666\right)\right)\right)\right)}\\
    
    \mathbf{else}:\\
    \;\;\;\;1 + t\_0 \cdot \left(1 + x \cdot \left(x \cdot \left(0.16666666666666666 \cdot \left(y \cdot \left(y \cdot \left(y \cdot y\right)\right)\right)\right)\right)\right)\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if (*.f64 (*.f64 x y) y) < -2e7

      1. Initial program 100.0%

        \[e^{\left(x \cdot y\right) \cdot y} \]
      2. Add Preprocessing
      3. Taylor expanded in x around 0

        \[\leadsto \color{blue}{1 + x \cdot \left(x \cdot \left(\frac{1}{6} \cdot \left(x \cdot {y}^{6}\right) + \frac{1}{2} \cdot {y}^{4}\right) + {y}^{2}\right)} \]
      4. Simplified1.7%

        \[\leadsto \color{blue}{1 + \left(x \cdot \left(y \cdot y\right)\right) \cdot \left(1 + \left(x \cdot \left(y \cdot y\right)\right) \cdot \left(0.5 + \left(x \cdot \left(y \cdot y\right)\right) \cdot 0.16666666666666666\right)\right)} \]
      5. Step-by-step derivation
        1. flip-+N/A

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

          \[\leadsto \mathsf{/.f64}\left(\left(1 \cdot 1 - \left(\left(x \cdot \left(y \cdot y\right)\right) \cdot \left(1 + \left(x \cdot \left(y \cdot y\right)\right) \cdot \left(\frac{1}{2} + \left(x \cdot \left(y \cdot y\right)\right) \cdot \frac{1}{6}\right)\right)\right) \cdot \left(\left(x \cdot \left(y \cdot y\right)\right) \cdot \left(1 + \left(x \cdot \left(y \cdot y\right)\right) \cdot \left(\frac{1}{2} + \left(x \cdot \left(y \cdot y\right)\right) \cdot \frac{1}{6}\right)\right)\right)\right), \color{blue}{\left(1 - \left(x \cdot \left(y \cdot y\right)\right) \cdot \left(1 + \left(x \cdot \left(y \cdot y\right)\right) \cdot \left(\frac{1}{2} + \left(x \cdot \left(y \cdot y\right)\right) \cdot \frac{1}{6}\right)\right)\right)}\right) \]
      6. Applied egg-rr0.3%

        \[\leadsto \color{blue}{\frac{1 - \left(1 + \left(x \cdot \left(y \cdot y\right)\right) \cdot \left(0.5 + x \cdot \left(\left(y \cdot y\right) \cdot 0.16666666666666666\right)\right)\right) \cdot \left(\left(x \cdot \left(y \cdot y\right)\right) \cdot \left(x \cdot \left(\left(y \cdot y\right) \cdot \left(1 + \left(x \cdot \left(y \cdot y\right)\right) \cdot \left(0.5 + x \cdot \left(\left(y \cdot y\right) \cdot 0.16666666666666666\right)\right)\right)\right)\right)\right)}{1 - x \cdot \left(\left(y \cdot y\right) \cdot \left(1 + \left(x \cdot \left(y \cdot y\right)\right) \cdot \left(0.5 + x \cdot \left(\left(y \cdot y\right) \cdot 0.16666666666666666\right)\right)\right)\right)}} \]
      7. Taylor expanded in x around 0

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

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

        if -2e7 < (*.f64 (*.f64 x y) y)

        1. Initial program 100.0%

          \[e^{\left(x \cdot y\right) \cdot y} \]
        2. Add Preprocessing
        3. Taylor expanded in x around 0

          \[\leadsto \color{blue}{1 + x \cdot \left(x \cdot \left(\frac{1}{6} \cdot \left(x \cdot {y}^{6}\right) + \frac{1}{2} \cdot {y}^{4}\right) + {y}^{2}\right)} \]
        4. Simplified96.0%

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

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

            \[\leadsto \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, \mathsf{*.f64}\left(y, y\right)\right), \mathsf{+.f64}\left(1, \left(\left({x}^{2} \cdot {y}^{4}\right) \cdot \color{blue}{\frac{1}{6}}\right)\right)\right)\right) \]
          2. unpow2N/A

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

            \[\leadsto \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, \mathsf{*.f64}\left(y, y\right)\right), \mathsf{+.f64}\left(1, \left(\left(x \cdot \left(x \cdot {y}^{4}\right)\right) \cdot \frac{1}{6}\right)\right)\right)\right) \]
          4. associate-*r*N/A

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

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

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

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

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

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

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

            \[\leadsto \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, \mathsf{*.f64}\left(y, y\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(\frac{1}{6}, \color{blue}{\left({y}^{4}\right)}\right)\right)\right)\right)\right)\right) \]
          12. metadata-evalN/A

            \[\leadsto \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, \mathsf{*.f64}\left(y, y\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(\frac{1}{6}, \left({y}^{\left(2 \cdot \color{blue}{2}\right)}\right)\right)\right)\right)\right)\right)\right) \]
          13. pow-sqrN/A

            \[\leadsto \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, \mathsf{*.f64}\left(y, y\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(\frac{1}{6}, \left({y}^{2} \cdot \color{blue}{{y}^{2}}\right)\right)\right)\right)\right)\right)\right) \]
          14. unpow2N/A

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

            \[\leadsto \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, \mathsf{*.f64}\left(y, y\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(\frac{1}{6}, \left(y \cdot \color{blue}{\left(y \cdot {y}^{2}\right)}\right)\right)\right)\right)\right)\right)\right) \]
          16. unpow2N/A

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

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

            \[\leadsto \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, \mathsf{*.f64}\left(y, y\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(\frac{1}{6}, \mathsf{*.f64}\left(y, \color{blue}{\left({y}^{3}\right)}\right)\right)\right)\right)\right)\right)\right) \]
          19. cube-multN/A

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

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

            \[\leadsto \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, \mathsf{*.f64}\left(y, y\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(\frac{1}{6}, \mathsf{*.f64}\left(y, \mathsf{*.f64}\left(y, \color{blue}{\left({y}^{2}\right)}\right)\right)\right)\right)\right)\right)\right)\right) \]
          22. unpow2N/A

            \[\leadsto \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, \mathsf{*.f64}\left(y, y\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(\frac{1}{6}, \mathsf{*.f64}\left(y, \mathsf{*.f64}\left(y, \left(y \cdot \color{blue}{y}\right)\right)\right)\right)\right)\right)\right)\right)\right) \]
          23. *-lowering-*.f6497.9%

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

          \[\leadsto 1 + \left(x \cdot \left(y \cdot y\right)\right) \cdot \left(1 + \color{blue}{x \cdot \left(x \cdot \left(0.16666666666666666 \cdot \left(y \cdot \left(y \cdot \left(y \cdot y\right)\right)\right)\right)\right)}\right) \]
      9. Recombined 2 regimes into one program.
      10. Final simplification95.8%

        \[\leadsto \begin{array}{l} \mathbf{if}\;y \cdot \left(x \cdot y\right) \leq -20000000:\\ \;\;\;\;\frac{1}{1 + x \cdot \left(\left(y \cdot y\right) \cdot \left(-1 - \left(x \cdot \left(y \cdot y\right)\right) \cdot \left(0.5 + x \cdot \left(\left(y \cdot y\right) \cdot 0.16666666666666666\right)\right)\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;1 + \left(x \cdot \left(y \cdot y\right)\right) \cdot \left(1 + x \cdot \left(x \cdot \left(0.16666666666666666 \cdot \left(y \cdot \left(y \cdot \left(y \cdot y\right)\right)\right)\right)\right)\right)\\ \end{array} \]
      11. Add Preprocessing

      Alternative 4: 91.7% accurate, 3.3× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \cdot \left(x \cdot y\right) \leq -20000000:\\ \;\;\;\;\frac{1}{1 + \left(y \cdot y\right) \cdot \left(y \cdot \left(y \cdot \left(-0.5 \cdot \left(x \cdot x\right)\right)\right) - x\right)}\\ \mathbf{else}:\\ \;\;\;\;1 + \left(x \cdot \left(y \cdot y\right)\right) \cdot \left(1 + x \cdot \left(x \cdot \left(0.16666666666666666 \cdot \left(y \cdot \left(y \cdot \left(y \cdot y\right)\right)\right)\right)\right)\right)\\ \end{array} \end{array} \]
      (FPCore (x y)
       :precision binary64
       (if (<= (* y (* x y)) -20000000.0)
         (/ 1.0 (+ 1.0 (* (* y y) (- (* y (* y (* -0.5 (* x x)))) x))))
         (+
          1.0
          (*
           (* x (* y y))
           (+ 1.0 (* x (* x (* 0.16666666666666666 (* y (* y (* y y)))))))))))
      double code(double x, double y) {
      	double tmp;
      	if ((y * (x * y)) <= -20000000.0) {
      		tmp = 1.0 / (1.0 + ((y * y) * ((y * (y * (-0.5 * (x * x)))) - x)));
      	} else {
      		tmp = 1.0 + ((x * (y * y)) * (1.0 + (x * (x * (0.16666666666666666 * (y * (y * (y * y))))))));
      	}
      	return tmp;
      }
      
      real(8) function code(x, y)
          real(8), intent (in) :: x
          real(8), intent (in) :: y
          real(8) :: tmp
          if ((y * (x * y)) <= (-20000000.0d0)) then
              tmp = 1.0d0 / (1.0d0 + ((y * y) * ((y * (y * ((-0.5d0) * (x * x)))) - x)))
          else
              tmp = 1.0d0 + ((x * (y * y)) * (1.0d0 + (x * (x * (0.16666666666666666d0 * (y * (y * (y * y))))))))
          end if
          code = tmp
      end function
      
      public static double code(double x, double y) {
      	double tmp;
      	if ((y * (x * y)) <= -20000000.0) {
      		tmp = 1.0 / (1.0 + ((y * y) * ((y * (y * (-0.5 * (x * x)))) - x)));
      	} else {
      		tmp = 1.0 + ((x * (y * y)) * (1.0 + (x * (x * (0.16666666666666666 * (y * (y * (y * y))))))));
      	}
      	return tmp;
      }
      
      def code(x, y):
      	tmp = 0
      	if (y * (x * y)) <= -20000000.0:
      		tmp = 1.0 / (1.0 + ((y * y) * ((y * (y * (-0.5 * (x * x)))) - x)))
      	else:
      		tmp = 1.0 + ((x * (y * y)) * (1.0 + (x * (x * (0.16666666666666666 * (y * (y * (y * y))))))))
      	return tmp
      
      function code(x, y)
      	tmp = 0.0
      	if (Float64(y * Float64(x * y)) <= -20000000.0)
      		tmp = Float64(1.0 / Float64(1.0 + Float64(Float64(y * y) * Float64(Float64(y * Float64(y * Float64(-0.5 * Float64(x * x)))) - x))));
      	else
      		tmp = Float64(1.0 + Float64(Float64(x * Float64(y * y)) * Float64(1.0 + Float64(x * Float64(x * Float64(0.16666666666666666 * Float64(y * Float64(y * Float64(y * y)))))))));
      	end
      	return tmp
      end
      
      function tmp_2 = code(x, y)
      	tmp = 0.0;
      	if ((y * (x * y)) <= -20000000.0)
      		tmp = 1.0 / (1.0 + ((y * y) * ((y * (y * (-0.5 * (x * x)))) - x)));
      	else
      		tmp = 1.0 + ((x * (y * y)) * (1.0 + (x * (x * (0.16666666666666666 * (y * (y * (y * y))))))));
      	end
      	tmp_2 = tmp;
      end
      
      code[x_, y_] := If[LessEqual[N[(y * N[(x * y), $MachinePrecision]), $MachinePrecision], -20000000.0], N[(1.0 / N[(1.0 + N[(N[(y * y), $MachinePrecision] * N[(N[(y * N[(y * N[(-0.5 * N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(N[(x * N[(y * y), $MachinePrecision]), $MachinePrecision] * N[(1.0 + N[(x * N[(x * N[(0.16666666666666666 * N[(y * N[(y * N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
      
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      \mathbf{if}\;y \cdot \left(x \cdot y\right) \leq -20000000:\\
      \;\;\;\;\frac{1}{1 + \left(y \cdot y\right) \cdot \left(y \cdot \left(y \cdot \left(-0.5 \cdot \left(x \cdot x\right)\right)\right) - x\right)}\\
      
      \mathbf{else}:\\
      \;\;\;\;1 + \left(x \cdot \left(y \cdot y\right)\right) \cdot \left(1 + x \cdot \left(x \cdot \left(0.16666666666666666 \cdot \left(y \cdot \left(y \cdot \left(y \cdot y\right)\right)\right)\right)\right)\right)\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 2 regimes
      2. if (*.f64 (*.f64 x y) y) < -2e7

        1. Initial program 100.0%

          \[e^{\left(x \cdot y\right) \cdot y} \]
        2. Add Preprocessing
        3. Taylor expanded in x around 0

          \[\leadsto \color{blue}{1 + x \cdot \left(x \cdot \left(\frac{1}{6} \cdot \left(x \cdot {y}^{6}\right) + \frac{1}{2} \cdot {y}^{4}\right) + {y}^{2}\right)} \]
        4. Simplified1.7%

          \[\leadsto \color{blue}{1 + \left(x \cdot \left(y \cdot y\right)\right) \cdot \left(1 + \left(x \cdot \left(y \cdot y\right)\right) \cdot \left(0.5 + \left(x \cdot \left(y \cdot y\right)\right) \cdot 0.16666666666666666\right)\right)} \]
        5. Step-by-step derivation
          1. flip-+N/A

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

            \[\leadsto \mathsf{/.f64}\left(\left(1 \cdot 1 - \left(\left(x \cdot \left(y \cdot y\right)\right) \cdot \left(1 + \left(x \cdot \left(y \cdot y\right)\right) \cdot \left(\frac{1}{2} + \left(x \cdot \left(y \cdot y\right)\right) \cdot \frac{1}{6}\right)\right)\right) \cdot \left(\left(x \cdot \left(y \cdot y\right)\right) \cdot \left(1 + \left(x \cdot \left(y \cdot y\right)\right) \cdot \left(\frac{1}{2} + \left(x \cdot \left(y \cdot y\right)\right) \cdot \frac{1}{6}\right)\right)\right)\right), \color{blue}{\left(1 - \left(x \cdot \left(y \cdot y\right)\right) \cdot \left(1 + \left(x \cdot \left(y \cdot y\right)\right) \cdot \left(\frac{1}{2} + \left(x \cdot \left(y \cdot y\right)\right) \cdot \frac{1}{6}\right)\right)\right)}\right) \]
        6. Applied egg-rr0.3%

          \[\leadsto \color{blue}{\frac{1 - \left(1 + \left(x \cdot \left(y \cdot y\right)\right) \cdot \left(0.5 + x \cdot \left(\left(y \cdot y\right) \cdot 0.16666666666666666\right)\right)\right) \cdot \left(\left(x \cdot \left(y \cdot y\right)\right) \cdot \left(x \cdot \left(\left(y \cdot y\right) \cdot \left(1 + \left(x \cdot \left(y \cdot y\right)\right) \cdot \left(0.5 + x \cdot \left(\left(y \cdot y\right) \cdot 0.16666666666666666\right)\right)\right)\right)\right)\right)}{1 - x \cdot \left(\left(y \cdot y\right) \cdot \left(1 + \left(x \cdot \left(y \cdot y\right)\right) \cdot \left(0.5 + x \cdot \left(\left(y \cdot y\right) \cdot 0.16666666666666666\right)\right)\right)\right)}} \]
        7. Taylor expanded in x around 0

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

            \[\leadsto \frac{\color{blue}{1}}{1 - x \cdot \left(\left(y \cdot y\right) \cdot \left(1 + \left(x \cdot \left(y \cdot y\right)\right) \cdot \left(0.5 + x \cdot \left(\left(y \cdot y\right) \cdot 0.16666666666666666\right)\right)\right)\right)} \]
          2. Taylor expanded in y around 0

            \[\leadsto \mathsf{/.f64}\left(1, \color{blue}{\left(1 + {y}^{2} \cdot \left(\frac{-1}{2} \cdot \left({x}^{2} \cdot {y}^{2}\right) - x\right)\right)}\right) \]
          3. Step-by-step derivation
            1. +-lowering-+.f64N/A

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

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

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

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

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

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

              \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(y, y\right), \mathsf{\_.f64}\left(\left({y}^{2} \cdot \left(\frac{-1}{2} \cdot {x}^{2}\right)\right), x\right)\right)\right)\right) \]
            8. unpow2N/A

              \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(y, y\right), \mathsf{\_.f64}\left(\left(\left(y \cdot y\right) \cdot \left(\frac{-1}{2} \cdot {x}^{2}\right)\right), x\right)\right)\right)\right) \]
            9. associate-*l*N/A

              \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(y, y\right), \mathsf{\_.f64}\left(\left(y \cdot \left(y \cdot \left(\frac{-1}{2} \cdot {x}^{2}\right)\right)\right), x\right)\right)\right)\right) \]
            10. *-lowering-*.f64N/A

              \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(y, y\right), \mathsf{\_.f64}\left(\mathsf{*.f64}\left(y, \left(y \cdot \left(\frac{-1}{2} \cdot {x}^{2}\right)\right)\right), x\right)\right)\right)\right) \]
            11. *-lowering-*.f64N/A

              \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(y, y\right), \mathsf{\_.f64}\left(\mathsf{*.f64}\left(y, \mathsf{*.f64}\left(y, \left(\frac{-1}{2} \cdot {x}^{2}\right)\right)\right), x\right)\right)\right)\right) \]
            12. *-lowering-*.f64N/A

              \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(y, y\right), \mathsf{\_.f64}\left(\mathsf{*.f64}\left(y, \mathsf{*.f64}\left(y, \mathsf{*.f64}\left(\frac{-1}{2}, \left({x}^{2}\right)\right)\right)\right), x\right)\right)\right)\right) \]
            13. unpow2N/A

              \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(y, y\right), \mathsf{\_.f64}\left(\mathsf{*.f64}\left(y, \mathsf{*.f64}\left(y, \mathsf{*.f64}\left(\frac{-1}{2}, \left(x \cdot x\right)\right)\right)\right), x\right)\right)\right)\right) \]
            14. *-lowering-*.f6480.7%

              \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(y, y\right), \mathsf{\_.f64}\left(\mathsf{*.f64}\left(y, \mathsf{*.f64}\left(y, \mathsf{*.f64}\left(\frac{-1}{2}, \mathsf{*.f64}\left(x, x\right)\right)\right)\right), x\right)\right)\right)\right) \]
          4. Simplified80.7%

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

          if -2e7 < (*.f64 (*.f64 x y) y)

          1. Initial program 100.0%

            \[e^{\left(x \cdot y\right) \cdot y} \]
          2. Add Preprocessing
          3. Taylor expanded in x around 0

            \[\leadsto \color{blue}{1 + x \cdot \left(x \cdot \left(\frac{1}{6} \cdot \left(x \cdot {y}^{6}\right) + \frac{1}{2} \cdot {y}^{4}\right) + {y}^{2}\right)} \]
          4. Simplified96.0%

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

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

              \[\leadsto \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, \mathsf{*.f64}\left(y, y\right)\right), \mathsf{+.f64}\left(1, \left(\left({x}^{2} \cdot {y}^{4}\right) \cdot \color{blue}{\frac{1}{6}}\right)\right)\right)\right) \]
            2. unpow2N/A

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

              \[\leadsto \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, \mathsf{*.f64}\left(y, y\right)\right), \mathsf{+.f64}\left(1, \left(\left(x \cdot \left(x \cdot {y}^{4}\right)\right) \cdot \frac{1}{6}\right)\right)\right)\right) \]
            4. associate-*r*N/A

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

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

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

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

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

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

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

              \[\leadsto \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, \mathsf{*.f64}\left(y, y\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(\frac{1}{6}, \color{blue}{\left({y}^{4}\right)}\right)\right)\right)\right)\right)\right) \]
            12. metadata-evalN/A

              \[\leadsto \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, \mathsf{*.f64}\left(y, y\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(\frac{1}{6}, \left({y}^{\left(2 \cdot \color{blue}{2}\right)}\right)\right)\right)\right)\right)\right)\right) \]
            13. pow-sqrN/A

              \[\leadsto \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, \mathsf{*.f64}\left(y, y\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(\frac{1}{6}, \left({y}^{2} \cdot \color{blue}{{y}^{2}}\right)\right)\right)\right)\right)\right)\right) \]
            14. unpow2N/A

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

              \[\leadsto \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, \mathsf{*.f64}\left(y, y\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(\frac{1}{6}, \left(y \cdot \color{blue}{\left(y \cdot {y}^{2}\right)}\right)\right)\right)\right)\right)\right)\right) \]
            16. unpow2N/A

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

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

              \[\leadsto \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, \mathsf{*.f64}\left(y, y\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(\frac{1}{6}, \mathsf{*.f64}\left(y, \color{blue}{\left({y}^{3}\right)}\right)\right)\right)\right)\right)\right)\right) \]
            19. cube-multN/A

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

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

              \[\leadsto \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, \mathsf{*.f64}\left(y, y\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(\frac{1}{6}, \mathsf{*.f64}\left(y, \mathsf{*.f64}\left(y, \color{blue}{\left({y}^{2}\right)}\right)\right)\right)\right)\right)\right)\right)\right) \]
            22. unpow2N/A

              \[\leadsto \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, \mathsf{*.f64}\left(y, y\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(\frac{1}{6}, \mathsf{*.f64}\left(y, \mathsf{*.f64}\left(y, \left(y \cdot \color{blue}{y}\right)\right)\right)\right)\right)\right)\right)\right)\right) \]
            23. *-lowering-*.f6497.9%

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

            \[\leadsto 1 + \left(x \cdot \left(y \cdot y\right)\right) \cdot \left(1 + \color{blue}{x \cdot \left(x \cdot \left(0.16666666666666666 \cdot \left(y \cdot \left(y \cdot \left(y \cdot y\right)\right)\right)\right)\right)}\right) \]
        9. Recombined 2 regimes into one program.
        10. Final simplification93.6%

          \[\leadsto \begin{array}{l} \mathbf{if}\;y \cdot \left(x \cdot y\right) \leq -20000000:\\ \;\;\;\;\frac{1}{1 + \left(y \cdot y\right) \cdot \left(y \cdot \left(y \cdot \left(-0.5 \cdot \left(x \cdot x\right)\right)\right) - x\right)}\\ \mathbf{else}:\\ \;\;\;\;1 + \left(x \cdot \left(y \cdot y\right)\right) \cdot \left(1 + x \cdot \left(x \cdot \left(0.16666666666666666 \cdot \left(y \cdot \left(y \cdot \left(y \cdot y\right)\right)\right)\right)\right)\right)\\ \end{array} \]
        11. Add Preprocessing

        Alternative 5: 91.4% accurate, 3.7× speedup?

        \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \cdot \left(x \cdot y\right) \leq 0.002:\\ \;\;\;\;\frac{1}{1 + x \cdot \left(y \cdot \left(y \cdot \left(-1 - x \cdot \left(\left(y \cdot y\right) \cdot 0.5\right)\right)\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(x \cdot \left(0.5 \cdot \left(y \cdot \left(y \cdot \left(y \cdot y\right)\right)\right)\right)\right)\\ \end{array} \end{array} \]
        (FPCore (x y)
         :precision binary64
         (if (<= (* y (* x y)) 0.002)
           (/ 1.0 (+ 1.0 (* x (* y (* y (- -1.0 (* x (* (* y y) 0.5))))))))
           (* x (* x (* 0.5 (* y (* y (* y y))))))))
        double code(double x, double y) {
        	double tmp;
        	if ((y * (x * y)) <= 0.002) {
        		tmp = 1.0 / (1.0 + (x * (y * (y * (-1.0 - (x * ((y * y) * 0.5)))))));
        	} else {
        		tmp = x * (x * (0.5 * (y * (y * (y * y)))));
        	}
        	return tmp;
        }
        
        real(8) function code(x, y)
            real(8), intent (in) :: x
            real(8), intent (in) :: y
            real(8) :: tmp
            if ((y * (x * y)) <= 0.002d0) then
                tmp = 1.0d0 / (1.0d0 + (x * (y * (y * ((-1.0d0) - (x * ((y * y) * 0.5d0)))))))
            else
                tmp = x * (x * (0.5d0 * (y * (y * (y * y)))))
            end if
            code = tmp
        end function
        
        public static double code(double x, double y) {
        	double tmp;
        	if ((y * (x * y)) <= 0.002) {
        		tmp = 1.0 / (1.0 + (x * (y * (y * (-1.0 - (x * ((y * y) * 0.5)))))));
        	} else {
        		tmp = x * (x * (0.5 * (y * (y * (y * y)))));
        	}
        	return tmp;
        }
        
        def code(x, y):
        	tmp = 0
        	if (y * (x * y)) <= 0.002:
        		tmp = 1.0 / (1.0 + (x * (y * (y * (-1.0 - (x * ((y * y) * 0.5)))))))
        	else:
        		tmp = x * (x * (0.5 * (y * (y * (y * y)))))
        	return tmp
        
        function code(x, y)
        	tmp = 0.0
        	if (Float64(y * Float64(x * y)) <= 0.002)
        		tmp = Float64(1.0 / Float64(1.0 + Float64(x * Float64(y * Float64(y * Float64(-1.0 - Float64(x * Float64(Float64(y * y) * 0.5))))))));
        	else
        		tmp = Float64(x * Float64(x * Float64(0.5 * Float64(y * Float64(y * Float64(y * y))))));
        	end
        	return tmp
        end
        
        function tmp_2 = code(x, y)
        	tmp = 0.0;
        	if ((y * (x * y)) <= 0.002)
        		tmp = 1.0 / (1.0 + (x * (y * (y * (-1.0 - (x * ((y * y) * 0.5)))))));
        	else
        		tmp = x * (x * (0.5 * (y * (y * (y * y)))));
        	end
        	tmp_2 = tmp;
        end
        
        code[x_, y_] := If[LessEqual[N[(y * N[(x * y), $MachinePrecision]), $MachinePrecision], 0.002], N[(1.0 / N[(1.0 + N[(x * N[(y * N[(y * N[(-1.0 - N[(x * N[(N[(y * y), $MachinePrecision] * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[(x * N[(0.5 * N[(y * N[(y * N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
        
        \begin{array}{l}
        
        \\
        \begin{array}{l}
        \mathbf{if}\;y \cdot \left(x \cdot y\right) \leq 0.002:\\
        \;\;\;\;\frac{1}{1 + x \cdot \left(y \cdot \left(y \cdot \left(-1 - x \cdot \left(\left(y \cdot y\right) \cdot 0.5\right)\right)\right)\right)}\\
        
        \mathbf{else}:\\
        \;\;\;\;x \cdot \left(x \cdot \left(0.5 \cdot \left(y \cdot \left(y \cdot \left(y \cdot y\right)\right)\right)\right)\right)\\
        
        
        \end{array}
        \end{array}
        
        Derivation
        1. Split input into 2 regimes
        2. if (*.f64 (*.f64 x y) y) < 2e-3

          1. Initial program 100.0%

            \[e^{\left(x \cdot y\right) \cdot y} \]
          2. Add Preprocessing
          3. Taylor expanded in x around 0

            \[\leadsto \color{blue}{1 + x \cdot \left(x \cdot \left(\frac{1}{6} \cdot \left(x \cdot {y}^{6}\right) + \frac{1}{2} \cdot {y}^{4}\right) + {y}^{2}\right)} \]
          4. Simplified69.1%

            \[\leadsto \color{blue}{1 + \left(x \cdot \left(y \cdot y\right)\right) \cdot \left(1 + \left(x \cdot \left(y \cdot y\right)\right) \cdot \left(0.5 + \left(x \cdot \left(y \cdot y\right)\right) \cdot 0.16666666666666666\right)\right)} \]
          5. Step-by-step derivation
            1. flip-+N/A

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

              \[\leadsto \mathsf{/.f64}\left(\left(1 \cdot 1 - \left(\left(x \cdot \left(y \cdot y\right)\right) \cdot \left(1 + \left(x \cdot \left(y \cdot y\right)\right) \cdot \left(\frac{1}{2} + \left(x \cdot \left(y \cdot y\right)\right) \cdot \frac{1}{6}\right)\right)\right) \cdot \left(\left(x \cdot \left(y \cdot y\right)\right) \cdot \left(1 + \left(x \cdot \left(y \cdot y\right)\right) \cdot \left(\frac{1}{2} + \left(x \cdot \left(y \cdot y\right)\right) \cdot \frac{1}{6}\right)\right)\right)\right), \color{blue}{\left(1 - \left(x \cdot \left(y \cdot y\right)\right) \cdot \left(1 + \left(x \cdot \left(y \cdot y\right)\right) \cdot \left(\frac{1}{2} + \left(x \cdot \left(y \cdot y\right)\right) \cdot \frac{1}{6}\right)\right)\right)}\right) \]
          6. Applied egg-rr68.6%

            \[\leadsto \color{blue}{\frac{1 - \left(1 + \left(x \cdot \left(y \cdot y\right)\right) \cdot \left(0.5 + x \cdot \left(\left(y \cdot y\right) \cdot 0.16666666666666666\right)\right)\right) \cdot \left(\left(x \cdot \left(y \cdot y\right)\right) \cdot \left(x \cdot \left(\left(y \cdot y\right) \cdot \left(1 + \left(x \cdot \left(y \cdot y\right)\right) \cdot \left(0.5 + x \cdot \left(\left(y \cdot y\right) \cdot 0.16666666666666666\right)\right)\right)\right)\right)\right)}{1 - x \cdot \left(\left(y \cdot y\right) \cdot \left(1 + \left(x \cdot \left(y \cdot y\right)\right) \cdot \left(0.5 + x \cdot \left(\left(y \cdot y\right) \cdot 0.16666666666666666\right)\right)\right)\right)}} \]
          7. Taylor expanded in x around 0

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

              \[\leadsto \frac{\color{blue}{1}}{1 - x \cdot \left(\left(y \cdot y\right) \cdot \left(1 + \left(x \cdot \left(y \cdot y\right)\right) \cdot \left(0.5 + x \cdot \left(\left(y \cdot y\right) \cdot 0.16666666666666666\right)\right)\right)\right)} \]
            2. Taylor expanded in y around 0

              \[\leadsto \mathsf{/.f64}\left(1, \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(x, \color{blue}{\left({y}^{2} \cdot \left(1 + \frac{1}{2} \cdot \left(x \cdot {y}^{2}\right)\right)\right)}\right)\right)\right) \]
            3. Step-by-step derivation
              1. unpow2N/A

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

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

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

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

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

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

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

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

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

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

                \[\leadsto \mathsf{/.f64}\left(1, \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(y, \mathsf{*.f64}\left(y, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(\left({y}^{2}\right), \color{blue}{\frac{1}{2}}\right)\right)\right)\right)\right)\right)\right)\right) \]
              12. unpow2N/A

                \[\leadsto \mathsf{/.f64}\left(1, \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(y, \mathsf{*.f64}\left(y, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(\left(y \cdot y\right), \frac{1}{2}\right)\right)\right)\right)\right)\right)\right)\right) \]
              13. *-lowering-*.f6492.9%

                \[\leadsto \mathsf{/.f64}\left(1, \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(y, \mathsf{*.f64}\left(y, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(\mathsf{*.f64}\left(y, y\right), \frac{1}{2}\right)\right)\right)\right)\right)\right)\right)\right) \]
            4. Simplified92.9%

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

            if 2e-3 < (*.f64 (*.f64 x y) y)

            1. Initial program 100.0%

              \[e^{\left(x \cdot y\right) \cdot y} \]
            2. Add Preprocessing
            3. Taylor expanded in x around 0

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

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

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

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

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

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

                \[\leadsto \mathsf{+.f64}\left(1, \left(x \cdot \left(x \cdot \left({y}^{\left(2 \cdot 2\right)} \cdot \frac{1}{2}\right) + {y}^{2}\right)\right)\right) \]
              7. pow-sqrN/A

                \[\leadsto \mathsf{+.f64}\left(1, \left(x \cdot \left(x \cdot \left(\left({y}^{2} \cdot {y}^{2}\right) \cdot \frac{1}{2}\right) + {y}^{2}\right)\right)\right) \]
              8. associate-*r*N/A

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

                \[\leadsto \mathsf{+.f64}\left(1, \left(x \cdot \left(x \cdot \left({y}^{2} \cdot \left(\frac{1}{2} \cdot {y}^{2}\right)\right) + {y}^{2}\right)\right)\right) \]
              10. associate-*l*N/A

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

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

                \[\leadsto \mathsf{+.f64}\left(1, \left(x \cdot \left(\left({y}^{2} \cdot \frac{1}{2}\right) \cdot \left(x \cdot {y}^{2}\right) + {y}^{2}\right)\right)\right) \]
              13. distribute-lft-inN/A

                \[\leadsto \mathsf{+.f64}\left(1, \left(x \cdot \left(\left({y}^{2} \cdot \frac{1}{2}\right) \cdot \left(x \cdot {y}^{2}\right)\right) + \color{blue}{x \cdot {y}^{2}}\right)\right) \]
            5. Simplified81.8%

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

              \[\leadsto \color{blue}{\frac{1}{2} \cdot \left({x}^{2} \cdot {y}^{4}\right)} \]
            7. Step-by-step derivation
              1. *-commutativeN/A

                \[\leadsto \frac{1}{2} \cdot \left({y}^{4} \cdot \color{blue}{{x}^{2}}\right) \]
              2. associate-*r*N/A

                \[\leadsto \left(\frac{1}{2} \cdot {y}^{4}\right) \cdot \color{blue}{{x}^{2}} \]
              3. *-rgt-identityN/A

                \[\leadsto \left(\frac{1}{2} \cdot {y}^{4}\right) \cdot \left({x}^{2} \cdot \color{blue}{1}\right) \]
              4. rgt-mult-inverseN/A

                \[\leadsto \left(\frac{1}{2} \cdot {y}^{4}\right) \cdot \left({x}^{2} \cdot \left(x \cdot \color{blue}{\frac{1}{x}}\right)\right) \]
              5. associate-*r/N/A

                \[\leadsto \left(\frac{1}{2} \cdot {y}^{4}\right) \cdot \left({x}^{2} \cdot \frac{x \cdot 1}{\color{blue}{x}}\right) \]
              6. *-rgt-identityN/A

                \[\leadsto \left(\frac{1}{2} \cdot {y}^{4}\right) \cdot \left({x}^{2} \cdot \frac{x}{x}\right) \]
              7. associate-/l*N/A

                \[\leadsto \left(\frac{1}{2} \cdot {y}^{4}\right) \cdot \frac{{x}^{2} \cdot x}{\color{blue}{x}} \]
              8. unpow2N/A

                \[\leadsto \left(\frac{1}{2} \cdot {y}^{4}\right) \cdot \frac{\left(x \cdot x\right) \cdot x}{x} \]
              9. unpow3N/A

                \[\leadsto \left(\frac{1}{2} \cdot {y}^{4}\right) \cdot \frac{{x}^{3}}{x} \]
              10. associate-/l*N/A

                \[\leadsto \frac{\left(\frac{1}{2} \cdot {y}^{4}\right) \cdot {x}^{3}}{\color{blue}{x}} \]
              11. associate-*l/N/A

                \[\leadsto \frac{\frac{1}{2} \cdot {y}^{4}}{x} \cdot \color{blue}{{x}^{3}} \]
              12. associate-*r/N/A

                \[\leadsto \left(\frac{1}{2} \cdot \frac{{y}^{4}}{x}\right) \cdot {\color{blue}{x}}^{3} \]
              13. unpow3N/A

                \[\leadsto \left(\frac{1}{2} \cdot \frac{{y}^{4}}{x}\right) \cdot \left(\left(x \cdot x\right) \cdot \color{blue}{x}\right) \]
              14. unpow2N/A

                \[\leadsto \left(\frac{1}{2} \cdot \frac{{y}^{4}}{x}\right) \cdot \left({x}^{2} \cdot x\right) \]
              15. associate-*r*N/A

                \[\leadsto \left(\left(\frac{1}{2} \cdot \frac{{y}^{4}}{x}\right) \cdot {x}^{2}\right) \cdot \color{blue}{x} \]
              16. *-commutativeN/A

                \[\leadsto x \cdot \color{blue}{\left(\left(\frac{1}{2} \cdot \frac{{y}^{4}}{x}\right) \cdot {x}^{2}\right)} \]
              17. *-lowering-*.f64N/A

                \[\leadsto \mathsf{*.f64}\left(x, \color{blue}{\left(\left(\frac{1}{2} \cdot \frac{{y}^{4}}{x}\right) \cdot {x}^{2}\right)}\right) \]
              18. associate-*r/N/A

                \[\leadsto \mathsf{*.f64}\left(x, \left(\frac{\frac{1}{2} \cdot {y}^{4}}{x} \cdot {\color{blue}{x}}^{2}\right)\right) \]
              19. associate-*l/N/A

                \[\leadsto \mathsf{*.f64}\left(x, \left(\frac{\left(\frac{1}{2} \cdot {y}^{4}\right) \cdot {x}^{2}}{\color{blue}{x}}\right)\right) \]
              20. associate-/l*N/A

                \[\leadsto \mathsf{*.f64}\left(x, \left(\left(\frac{1}{2} \cdot {y}^{4}\right) \cdot \color{blue}{\frac{{x}^{2}}{x}}\right)\right) \]
              21. unpow2N/A

                \[\leadsto \mathsf{*.f64}\left(x, \left(\left(\frac{1}{2} \cdot {y}^{4}\right) \cdot \frac{x \cdot x}{x}\right)\right) \]
              22. associate-/l*N/A

                \[\leadsto \mathsf{*.f64}\left(x, \left(\left(\frac{1}{2} \cdot {y}^{4}\right) \cdot \left(x \cdot \color{blue}{\frac{x}{x}}\right)\right)\right) \]
              23. *-rgt-identityN/A

                \[\leadsto \mathsf{*.f64}\left(x, \left(\left(\frac{1}{2} \cdot {y}^{4}\right) \cdot \left(x \cdot \frac{x \cdot 1}{x}\right)\right)\right) \]
              24. associate-*r/N/A

                \[\leadsto \mathsf{*.f64}\left(x, \left(\left(\frac{1}{2} \cdot {y}^{4}\right) \cdot \left(x \cdot \left(x \cdot \color{blue}{\frac{1}{x}}\right)\right)\right)\right) \]
              25. rgt-mult-inverseN/A

                \[\leadsto \mathsf{*.f64}\left(x, \left(\left(\frac{1}{2} \cdot {y}^{4}\right) \cdot \left(x \cdot 1\right)\right)\right) \]
            8. Simplified90.9%

              \[\leadsto \color{blue}{x \cdot \left(x \cdot \left(0.5 \cdot \left(y \cdot \left(y \cdot \left(y \cdot y\right)\right)\right)\right)\right)} \]
          9. Recombined 2 regimes into one program.
          10. Final simplification92.5%

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

          Alternative 6: 91.2% accurate, 3.7× speedup?

          \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \cdot \left(x \cdot y\right) \leq -20000000:\\ \;\;\;\;\frac{1}{1 + \left(y \cdot y\right) \cdot \left(y \cdot \left(y \cdot \left(-0.5 \cdot \left(x \cdot x\right)\right)\right) - x\right)}\\ \mathbf{else}:\\ \;\;\;\;1 + y \cdot \left(\left(x \cdot y\right) \cdot \left(1 + x \cdot \left(y \cdot \frac{y}{2}\right)\right)\right)\\ \end{array} \end{array} \]
          (FPCore (x y)
           :precision binary64
           (if (<= (* y (* x y)) -20000000.0)
             (/ 1.0 (+ 1.0 (* (* y y) (- (* y (* y (* -0.5 (* x x)))) x))))
             (+ 1.0 (* y (* (* x y) (+ 1.0 (* x (* y (/ y 2.0)))))))))
          double code(double x, double y) {
          	double tmp;
          	if ((y * (x * y)) <= -20000000.0) {
          		tmp = 1.0 / (1.0 + ((y * y) * ((y * (y * (-0.5 * (x * x)))) - x)));
          	} else {
          		tmp = 1.0 + (y * ((x * y) * (1.0 + (x * (y * (y / 2.0))))));
          	}
          	return tmp;
          }
          
          real(8) function code(x, y)
              real(8), intent (in) :: x
              real(8), intent (in) :: y
              real(8) :: tmp
              if ((y * (x * y)) <= (-20000000.0d0)) then
                  tmp = 1.0d0 / (1.0d0 + ((y * y) * ((y * (y * ((-0.5d0) * (x * x)))) - x)))
              else
                  tmp = 1.0d0 + (y * ((x * y) * (1.0d0 + (x * (y * (y / 2.0d0))))))
              end if
              code = tmp
          end function
          
          public static double code(double x, double y) {
          	double tmp;
          	if ((y * (x * y)) <= -20000000.0) {
          		tmp = 1.0 / (1.0 + ((y * y) * ((y * (y * (-0.5 * (x * x)))) - x)));
          	} else {
          		tmp = 1.0 + (y * ((x * y) * (1.0 + (x * (y * (y / 2.0))))));
          	}
          	return tmp;
          }
          
          def code(x, y):
          	tmp = 0
          	if (y * (x * y)) <= -20000000.0:
          		tmp = 1.0 / (1.0 + ((y * y) * ((y * (y * (-0.5 * (x * x)))) - x)))
          	else:
          		tmp = 1.0 + (y * ((x * y) * (1.0 + (x * (y * (y / 2.0))))))
          	return tmp
          
          function code(x, y)
          	tmp = 0.0
          	if (Float64(y * Float64(x * y)) <= -20000000.0)
          		tmp = Float64(1.0 / Float64(1.0 + Float64(Float64(y * y) * Float64(Float64(y * Float64(y * Float64(-0.5 * Float64(x * x)))) - x))));
          	else
          		tmp = Float64(1.0 + Float64(y * Float64(Float64(x * y) * Float64(1.0 + Float64(x * Float64(y * Float64(y / 2.0)))))));
          	end
          	return tmp
          end
          
          function tmp_2 = code(x, y)
          	tmp = 0.0;
          	if ((y * (x * y)) <= -20000000.0)
          		tmp = 1.0 / (1.0 + ((y * y) * ((y * (y * (-0.5 * (x * x)))) - x)));
          	else
          		tmp = 1.0 + (y * ((x * y) * (1.0 + (x * (y * (y / 2.0))))));
          	end
          	tmp_2 = tmp;
          end
          
          code[x_, y_] := If[LessEqual[N[(y * N[(x * y), $MachinePrecision]), $MachinePrecision], -20000000.0], N[(1.0 / N[(1.0 + N[(N[(y * y), $MachinePrecision] * N[(N[(y * N[(y * N[(-0.5 * N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(y * N[(N[(x * y), $MachinePrecision] * N[(1.0 + N[(x * N[(y * N[(y / 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
          
          \begin{array}{l}
          
          \\
          \begin{array}{l}
          \mathbf{if}\;y \cdot \left(x \cdot y\right) \leq -20000000:\\
          \;\;\;\;\frac{1}{1 + \left(y \cdot y\right) \cdot \left(y \cdot \left(y \cdot \left(-0.5 \cdot \left(x \cdot x\right)\right)\right) - x\right)}\\
          
          \mathbf{else}:\\
          \;\;\;\;1 + y \cdot \left(\left(x \cdot y\right) \cdot \left(1 + x \cdot \left(y \cdot \frac{y}{2}\right)\right)\right)\\
          
          
          \end{array}
          \end{array}
          
          Derivation
          1. Split input into 2 regimes
          2. if (*.f64 (*.f64 x y) y) < -2e7

            1. Initial program 100.0%

              \[e^{\left(x \cdot y\right) \cdot y} \]
            2. Add Preprocessing
            3. Taylor expanded in x around 0

              \[\leadsto \color{blue}{1 + x \cdot \left(x \cdot \left(\frac{1}{6} \cdot \left(x \cdot {y}^{6}\right) + \frac{1}{2} \cdot {y}^{4}\right) + {y}^{2}\right)} \]
            4. Simplified1.7%

              \[\leadsto \color{blue}{1 + \left(x \cdot \left(y \cdot y\right)\right) \cdot \left(1 + \left(x \cdot \left(y \cdot y\right)\right) \cdot \left(0.5 + \left(x \cdot \left(y \cdot y\right)\right) \cdot 0.16666666666666666\right)\right)} \]
            5. Step-by-step derivation
              1. flip-+N/A

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

                \[\leadsto \mathsf{/.f64}\left(\left(1 \cdot 1 - \left(\left(x \cdot \left(y \cdot y\right)\right) \cdot \left(1 + \left(x \cdot \left(y \cdot y\right)\right) \cdot \left(\frac{1}{2} + \left(x \cdot \left(y \cdot y\right)\right) \cdot \frac{1}{6}\right)\right)\right) \cdot \left(\left(x \cdot \left(y \cdot y\right)\right) \cdot \left(1 + \left(x \cdot \left(y \cdot y\right)\right) \cdot \left(\frac{1}{2} + \left(x \cdot \left(y \cdot y\right)\right) \cdot \frac{1}{6}\right)\right)\right)\right), \color{blue}{\left(1 - \left(x \cdot \left(y \cdot y\right)\right) \cdot \left(1 + \left(x \cdot \left(y \cdot y\right)\right) \cdot \left(\frac{1}{2} + \left(x \cdot \left(y \cdot y\right)\right) \cdot \frac{1}{6}\right)\right)\right)}\right) \]
            6. Applied egg-rr0.3%

              \[\leadsto \color{blue}{\frac{1 - \left(1 + \left(x \cdot \left(y \cdot y\right)\right) \cdot \left(0.5 + x \cdot \left(\left(y \cdot y\right) \cdot 0.16666666666666666\right)\right)\right) \cdot \left(\left(x \cdot \left(y \cdot y\right)\right) \cdot \left(x \cdot \left(\left(y \cdot y\right) \cdot \left(1 + \left(x \cdot \left(y \cdot y\right)\right) \cdot \left(0.5 + x \cdot \left(\left(y \cdot y\right) \cdot 0.16666666666666666\right)\right)\right)\right)\right)\right)}{1 - x \cdot \left(\left(y \cdot y\right) \cdot \left(1 + \left(x \cdot \left(y \cdot y\right)\right) \cdot \left(0.5 + x \cdot \left(\left(y \cdot y\right) \cdot 0.16666666666666666\right)\right)\right)\right)}} \]
            7. Taylor expanded in x around 0

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

                \[\leadsto \frac{\color{blue}{1}}{1 - x \cdot \left(\left(y \cdot y\right) \cdot \left(1 + \left(x \cdot \left(y \cdot y\right)\right) \cdot \left(0.5 + x \cdot \left(\left(y \cdot y\right) \cdot 0.16666666666666666\right)\right)\right)\right)} \]
              2. Taylor expanded in y around 0

                \[\leadsto \mathsf{/.f64}\left(1, \color{blue}{\left(1 + {y}^{2} \cdot \left(\frac{-1}{2} \cdot \left({x}^{2} \cdot {y}^{2}\right) - x\right)\right)}\right) \]
              3. Step-by-step derivation
                1. +-lowering-+.f64N/A

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

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

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

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

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

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

                  \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(y, y\right), \mathsf{\_.f64}\left(\left({y}^{2} \cdot \left(\frac{-1}{2} \cdot {x}^{2}\right)\right), x\right)\right)\right)\right) \]
                8. unpow2N/A

                  \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(y, y\right), \mathsf{\_.f64}\left(\left(\left(y \cdot y\right) \cdot \left(\frac{-1}{2} \cdot {x}^{2}\right)\right), x\right)\right)\right)\right) \]
                9. associate-*l*N/A

                  \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(y, y\right), \mathsf{\_.f64}\left(\left(y \cdot \left(y \cdot \left(\frac{-1}{2} \cdot {x}^{2}\right)\right)\right), x\right)\right)\right)\right) \]
                10. *-lowering-*.f64N/A

                  \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(y, y\right), \mathsf{\_.f64}\left(\mathsf{*.f64}\left(y, \left(y \cdot \left(\frac{-1}{2} \cdot {x}^{2}\right)\right)\right), x\right)\right)\right)\right) \]
                11. *-lowering-*.f64N/A

                  \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(y, y\right), \mathsf{\_.f64}\left(\mathsf{*.f64}\left(y, \mathsf{*.f64}\left(y, \left(\frac{-1}{2} \cdot {x}^{2}\right)\right)\right), x\right)\right)\right)\right) \]
                12. *-lowering-*.f64N/A

                  \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(y, y\right), \mathsf{\_.f64}\left(\mathsf{*.f64}\left(y, \mathsf{*.f64}\left(y, \mathsf{*.f64}\left(\frac{-1}{2}, \left({x}^{2}\right)\right)\right)\right), x\right)\right)\right)\right) \]
                13. unpow2N/A

                  \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(y, y\right), \mathsf{\_.f64}\left(\mathsf{*.f64}\left(y, \mathsf{*.f64}\left(y, \mathsf{*.f64}\left(\frac{-1}{2}, \left(x \cdot x\right)\right)\right)\right), x\right)\right)\right)\right) \]
                14. *-lowering-*.f6480.7%

                  \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(y, y\right), \mathsf{\_.f64}\left(\mathsf{*.f64}\left(y, \mathsf{*.f64}\left(y, \mathsf{*.f64}\left(\frac{-1}{2}, \mathsf{*.f64}\left(x, x\right)\right)\right)\right), x\right)\right)\right)\right) \]
              4. Simplified80.7%

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

              if -2e7 < (*.f64 (*.f64 x y) y)

              1. Initial program 100.0%

                \[e^{\left(x \cdot y\right) \cdot y} \]
              2. Add Preprocessing
              3. Taylor expanded in x around 0

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

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

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

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

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

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

                  \[\leadsto \mathsf{+.f64}\left(1, \left(x \cdot \left(x \cdot \left({y}^{\left(2 \cdot 2\right)} \cdot \frac{1}{2}\right) + {y}^{2}\right)\right)\right) \]
                7. pow-sqrN/A

                  \[\leadsto \mathsf{+.f64}\left(1, \left(x \cdot \left(x \cdot \left(\left({y}^{2} \cdot {y}^{2}\right) \cdot \frac{1}{2}\right) + {y}^{2}\right)\right)\right) \]
                8. associate-*r*N/A

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

                  \[\leadsto \mathsf{+.f64}\left(1, \left(x \cdot \left(x \cdot \left({y}^{2} \cdot \left(\frac{1}{2} \cdot {y}^{2}\right)\right) + {y}^{2}\right)\right)\right) \]
                10. associate-*l*N/A

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

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

                  \[\leadsto \mathsf{+.f64}\left(1, \left(x \cdot \left(\left({y}^{2} \cdot \frac{1}{2}\right) \cdot \left(x \cdot {y}^{2}\right) + {y}^{2}\right)\right)\right) \]
                13. distribute-lft-inN/A

                  \[\leadsto \mathsf{+.f64}\left(1, \left(x \cdot \left(\left({y}^{2} \cdot \frac{1}{2}\right) \cdot \left(x \cdot {y}^{2}\right)\right) + \color{blue}{x \cdot {y}^{2}}\right)\right) \]
              5. Simplified94.8%

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

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

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

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

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

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

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

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

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

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

                  \[\leadsto \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \left(y \cdot \left(y \cdot \frac{1}{2}\right)\right)\right)\right), \left(x \cdot y\right)\right), y\right)\right) \]
                11. div-invN/A

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

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

                  \[\leadsto \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(y, \mathsf{/.f64}\left(y, 2\right)\right)\right)\right), \left(x \cdot y\right)\right), y\right)\right) \]
                14. *-lowering-*.f6495.3%

                  \[\leadsto \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(y, \mathsf{/.f64}\left(y, 2\right)\right)\right)\right), \mathsf{*.f64}\left(x, y\right)\right), y\right)\right) \]
              7. Applied egg-rr95.3%

                \[\leadsto 1 + \color{blue}{\left(\left(1 + x \cdot \left(y \cdot \frac{y}{2}\right)\right) \cdot \left(x \cdot y\right)\right) \cdot y} \]
            9. Recombined 2 regimes into one program.
            10. Final simplification91.6%

              \[\leadsto \begin{array}{l} \mathbf{if}\;y \cdot \left(x \cdot y\right) \leq -20000000:\\ \;\;\;\;\frac{1}{1 + \left(y \cdot y\right) \cdot \left(y \cdot \left(y \cdot \left(-0.5 \cdot \left(x \cdot x\right)\right)\right) - x\right)}\\ \mathbf{else}:\\ \;\;\;\;1 + y \cdot \left(\left(x \cdot y\right) \cdot \left(1 + x \cdot \left(y \cdot \frac{y}{2}\right)\right)\right)\\ \end{array} \]
            11. Add Preprocessing

            Alternative 7: 87.4% accurate, 4.8× speedup?

            \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \cdot \left(x \cdot y\right) \leq 0.002:\\ \;\;\;\;\frac{1}{1 - x \cdot \left(y \cdot y\right)}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(x \cdot \left(0.5 \cdot \left(y \cdot \left(y \cdot \left(y \cdot y\right)\right)\right)\right)\right)\\ \end{array} \end{array} \]
            (FPCore (x y)
             :precision binary64
             (if (<= (* y (* x y)) 0.002)
               (/ 1.0 (- 1.0 (* x (* y y))))
               (* x (* x (* 0.5 (* y (* y (* y y))))))))
            double code(double x, double y) {
            	double tmp;
            	if ((y * (x * y)) <= 0.002) {
            		tmp = 1.0 / (1.0 - (x * (y * y)));
            	} else {
            		tmp = x * (x * (0.5 * (y * (y * (y * y)))));
            	}
            	return tmp;
            }
            
            real(8) function code(x, y)
                real(8), intent (in) :: x
                real(8), intent (in) :: y
                real(8) :: tmp
                if ((y * (x * y)) <= 0.002d0) then
                    tmp = 1.0d0 / (1.0d0 - (x * (y * y)))
                else
                    tmp = x * (x * (0.5d0 * (y * (y * (y * y)))))
                end if
                code = tmp
            end function
            
            public static double code(double x, double y) {
            	double tmp;
            	if ((y * (x * y)) <= 0.002) {
            		tmp = 1.0 / (1.0 - (x * (y * y)));
            	} else {
            		tmp = x * (x * (0.5 * (y * (y * (y * y)))));
            	}
            	return tmp;
            }
            
            def code(x, y):
            	tmp = 0
            	if (y * (x * y)) <= 0.002:
            		tmp = 1.0 / (1.0 - (x * (y * y)))
            	else:
            		tmp = x * (x * (0.5 * (y * (y * (y * y)))))
            	return tmp
            
            function code(x, y)
            	tmp = 0.0
            	if (Float64(y * Float64(x * y)) <= 0.002)
            		tmp = Float64(1.0 / Float64(1.0 - Float64(x * Float64(y * y))));
            	else
            		tmp = Float64(x * Float64(x * Float64(0.5 * Float64(y * Float64(y * Float64(y * y))))));
            	end
            	return tmp
            end
            
            function tmp_2 = code(x, y)
            	tmp = 0.0;
            	if ((y * (x * y)) <= 0.002)
            		tmp = 1.0 / (1.0 - (x * (y * y)));
            	else
            		tmp = x * (x * (0.5 * (y * (y * (y * y)))));
            	end
            	tmp_2 = tmp;
            end
            
            code[x_, y_] := If[LessEqual[N[(y * N[(x * y), $MachinePrecision]), $MachinePrecision], 0.002], N[(1.0 / N[(1.0 - N[(x * N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[(x * N[(0.5 * N[(y * N[(y * N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
            
            \begin{array}{l}
            
            \\
            \begin{array}{l}
            \mathbf{if}\;y \cdot \left(x \cdot y\right) \leq 0.002:\\
            \;\;\;\;\frac{1}{1 - x \cdot \left(y \cdot y\right)}\\
            
            \mathbf{else}:\\
            \;\;\;\;x \cdot \left(x \cdot \left(0.5 \cdot \left(y \cdot \left(y \cdot \left(y \cdot y\right)\right)\right)\right)\right)\\
            
            
            \end{array}
            \end{array}
            
            Derivation
            1. Split input into 2 regimes
            2. if (*.f64 (*.f64 x y) y) < 2e-3

              1. Initial program 100.0%

                \[e^{\left(x \cdot y\right) \cdot y} \]
              2. Add Preprocessing
              3. Taylor expanded in x around 0

                \[\leadsto \color{blue}{1 + x \cdot \left(x \cdot \left(\frac{1}{6} \cdot \left(x \cdot {y}^{6}\right) + \frac{1}{2} \cdot {y}^{4}\right) + {y}^{2}\right)} \]
              4. Simplified69.1%

                \[\leadsto \color{blue}{1 + \left(x \cdot \left(y \cdot y\right)\right) \cdot \left(1 + \left(x \cdot \left(y \cdot y\right)\right) \cdot \left(0.5 + \left(x \cdot \left(y \cdot y\right)\right) \cdot 0.16666666666666666\right)\right)} \]
              5. Step-by-step derivation
                1. flip-+N/A

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

                  \[\leadsto \mathsf{/.f64}\left(\left(1 \cdot 1 - \left(\left(x \cdot \left(y \cdot y\right)\right) \cdot \left(1 + \left(x \cdot \left(y \cdot y\right)\right) \cdot \left(\frac{1}{2} + \left(x \cdot \left(y \cdot y\right)\right) \cdot \frac{1}{6}\right)\right)\right) \cdot \left(\left(x \cdot \left(y \cdot y\right)\right) \cdot \left(1 + \left(x \cdot \left(y \cdot y\right)\right) \cdot \left(\frac{1}{2} + \left(x \cdot \left(y \cdot y\right)\right) \cdot \frac{1}{6}\right)\right)\right)\right), \color{blue}{\left(1 - \left(x \cdot \left(y \cdot y\right)\right) \cdot \left(1 + \left(x \cdot \left(y \cdot y\right)\right) \cdot \left(\frac{1}{2} + \left(x \cdot \left(y \cdot y\right)\right) \cdot \frac{1}{6}\right)\right)\right)}\right) \]
              6. Applied egg-rr68.6%

                \[\leadsto \color{blue}{\frac{1 - \left(1 + \left(x \cdot \left(y \cdot y\right)\right) \cdot \left(0.5 + x \cdot \left(\left(y \cdot y\right) \cdot 0.16666666666666666\right)\right)\right) \cdot \left(\left(x \cdot \left(y \cdot y\right)\right) \cdot \left(x \cdot \left(\left(y \cdot y\right) \cdot \left(1 + \left(x \cdot \left(y \cdot y\right)\right) \cdot \left(0.5 + x \cdot \left(\left(y \cdot y\right) \cdot 0.16666666666666666\right)\right)\right)\right)\right)\right)}{1 - x \cdot \left(\left(y \cdot y\right) \cdot \left(1 + \left(x \cdot \left(y \cdot y\right)\right) \cdot \left(0.5 + x \cdot \left(\left(y \cdot y\right) \cdot 0.16666666666666666\right)\right)\right)\right)}} \]
              7. Taylor expanded in x around 0

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

                  \[\leadsto \frac{\color{blue}{1}}{1 - x \cdot \left(\left(y \cdot y\right) \cdot \left(1 + \left(x \cdot \left(y \cdot y\right)\right) \cdot \left(0.5 + x \cdot \left(\left(y \cdot y\right) \cdot 0.16666666666666666\right)\right)\right)\right)} \]
                2. Taylor expanded in x around 0

                  \[\leadsto \mathsf{/.f64}\left(1, \color{blue}{\left(1 + -1 \cdot \left(x \cdot {y}^{2}\right)\right)}\right) \]
                3. Step-by-step derivation
                  1. mul-1-negN/A

                    \[\leadsto \mathsf{/.f64}\left(1, \left(1 + \left(\mathsf{neg}\left(x \cdot {y}^{2}\right)\right)\right)\right) \]
                  2. unsub-negN/A

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

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

                    \[\leadsto \mathsf{/.f64}\left(1, \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(x, \color{blue}{\left({y}^{2}\right)}\right)\right)\right) \]
                  5. unpow2N/A

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

                    \[\leadsto \mathsf{/.f64}\left(1, \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(y, \color{blue}{y}\right)\right)\right)\right) \]
                4. Simplified86.4%

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

                if 2e-3 < (*.f64 (*.f64 x y) y)

                1. Initial program 100.0%

                  \[e^{\left(x \cdot y\right) \cdot y} \]
                2. Add Preprocessing
                3. Taylor expanded in x around 0

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

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

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

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

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

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

                    \[\leadsto \mathsf{+.f64}\left(1, \left(x \cdot \left(x \cdot \left({y}^{\left(2 \cdot 2\right)} \cdot \frac{1}{2}\right) + {y}^{2}\right)\right)\right) \]
                  7. pow-sqrN/A

                    \[\leadsto \mathsf{+.f64}\left(1, \left(x \cdot \left(x \cdot \left(\left({y}^{2} \cdot {y}^{2}\right) \cdot \frac{1}{2}\right) + {y}^{2}\right)\right)\right) \]
                  8. associate-*r*N/A

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

                    \[\leadsto \mathsf{+.f64}\left(1, \left(x \cdot \left(x \cdot \left({y}^{2} \cdot \left(\frac{1}{2} \cdot {y}^{2}\right)\right) + {y}^{2}\right)\right)\right) \]
                  10. associate-*l*N/A

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

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

                    \[\leadsto \mathsf{+.f64}\left(1, \left(x \cdot \left(\left({y}^{2} \cdot \frac{1}{2}\right) \cdot \left(x \cdot {y}^{2}\right) + {y}^{2}\right)\right)\right) \]
                  13. distribute-lft-inN/A

                    \[\leadsto \mathsf{+.f64}\left(1, \left(x \cdot \left(\left({y}^{2} \cdot \frac{1}{2}\right) \cdot \left(x \cdot {y}^{2}\right)\right) + \color{blue}{x \cdot {y}^{2}}\right)\right) \]
                5. Simplified81.8%

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

                  \[\leadsto \color{blue}{\frac{1}{2} \cdot \left({x}^{2} \cdot {y}^{4}\right)} \]
                7. Step-by-step derivation
                  1. *-commutativeN/A

                    \[\leadsto \frac{1}{2} \cdot \left({y}^{4} \cdot \color{blue}{{x}^{2}}\right) \]
                  2. associate-*r*N/A

                    \[\leadsto \left(\frac{1}{2} \cdot {y}^{4}\right) \cdot \color{blue}{{x}^{2}} \]
                  3. *-rgt-identityN/A

                    \[\leadsto \left(\frac{1}{2} \cdot {y}^{4}\right) \cdot \left({x}^{2} \cdot \color{blue}{1}\right) \]
                  4. rgt-mult-inverseN/A

                    \[\leadsto \left(\frac{1}{2} \cdot {y}^{4}\right) \cdot \left({x}^{2} \cdot \left(x \cdot \color{blue}{\frac{1}{x}}\right)\right) \]
                  5. associate-*r/N/A

                    \[\leadsto \left(\frac{1}{2} \cdot {y}^{4}\right) \cdot \left({x}^{2} \cdot \frac{x \cdot 1}{\color{blue}{x}}\right) \]
                  6. *-rgt-identityN/A

                    \[\leadsto \left(\frac{1}{2} \cdot {y}^{4}\right) \cdot \left({x}^{2} \cdot \frac{x}{x}\right) \]
                  7. associate-/l*N/A

                    \[\leadsto \left(\frac{1}{2} \cdot {y}^{4}\right) \cdot \frac{{x}^{2} \cdot x}{\color{blue}{x}} \]
                  8. unpow2N/A

                    \[\leadsto \left(\frac{1}{2} \cdot {y}^{4}\right) \cdot \frac{\left(x \cdot x\right) \cdot x}{x} \]
                  9. unpow3N/A

                    \[\leadsto \left(\frac{1}{2} \cdot {y}^{4}\right) \cdot \frac{{x}^{3}}{x} \]
                  10. associate-/l*N/A

                    \[\leadsto \frac{\left(\frac{1}{2} \cdot {y}^{4}\right) \cdot {x}^{3}}{\color{blue}{x}} \]
                  11. associate-*l/N/A

                    \[\leadsto \frac{\frac{1}{2} \cdot {y}^{4}}{x} \cdot \color{blue}{{x}^{3}} \]
                  12. associate-*r/N/A

                    \[\leadsto \left(\frac{1}{2} \cdot \frac{{y}^{4}}{x}\right) \cdot {\color{blue}{x}}^{3} \]
                  13. unpow3N/A

                    \[\leadsto \left(\frac{1}{2} \cdot \frac{{y}^{4}}{x}\right) \cdot \left(\left(x \cdot x\right) \cdot \color{blue}{x}\right) \]
                  14. unpow2N/A

                    \[\leadsto \left(\frac{1}{2} \cdot \frac{{y}^{4}}{x}\right) \cdot \left({x}^{2} \cdot x\right) \]
                  15. associate-*r*N/A

                    \[\leadsto \left(\left(\frac{1}{2} \cdot \frac{{y}^{4}}{x}\right) \cdot {x}^{2}\right) \cdot \color{blue}{x} \]
                  16. *-commutativeN/A

                    \[\leadsto x \cdot \color{blue}{\left(\left(\frac{1}{2} \cdot \frac{{y}^{4}}{x}\right) \cdot {x}^{2}\right)} \]
                  17. *-lowering-*.f64N/A

                    \[\leadsto \mathsf{*.f64}\left(x, \color{blue}{\left(\left(\frac{1}{2} \cdot \frac{{y}^{4}}{x}\right) \cdot {x}^{2}\right)}\right) \]
                  18. associate-*r/N/A

                    \[\leadsto \mathsf{*.f64}\left(x, \left(\frac{\frac{1}{2} \cdot {y}^{4}}{x} \cdot {\color{blue}{x}}^{2}\right)\right) \]
                  19. associate-*l/N/A

                    \[\leadsto \mathsf{*.f64}\left(x, \left(\frac{\left(\frac{1}{2} \cdot {y}^{4}\right) \cdot {x}^{2}}{\color{blue}{x}}\right)\right) \]
                  20. associate-/l*N/A

                    \[\leadsto \mathsf{*.f64}\left(x, \left(\left(\frac{1}{2} \cdot {y}^{4}\right) \cdot \color{blue}{\frac{{x}^{2}}{x}}\right)\right) \]
                  21. unpow2N/A

                    \[\leadsto \mathsf{*.f64}\left(x, \left(\left(\frac{1}{2} \cdot {y}^{4}\right) \cdot \frac{x \cdot x}{x}\right)\right) \]
                  22. associate-/l*N/A

                    \[\leadsto \mathsf{*.f64}\left(x, \left(\left(\frac{1}{2} \cdot {y}^{4}\right) \cdot \left(x \cdot \color{blue}{\frac{x}{x}}\right)\right)\right) \]
                  23. *-rgt-identityN/A

                    \[\leadsto \mathsf{*.f64}\left(x, \left(\left(\frac{1}{2} \cdot {y}^{4}\right) \cdot \left(x \cdot \frac{x \cdot 1}{x}\right)\right)\right) \]
                  24. associate-*r/N/A

                    \[\leadsto \mathsf{*.f64}\left(x, \left(\left(\frac{1}{2} \cdot {y}^{4}\right) \cdot \left(x \cdot \left(x \cdot \color{blue}{\frac{1}{x}}\right)\right)\right)\right) \]
                  25. rgt-mult-inverseN/A

                    \[\leadsto \mathsf{*.f64}\left(x, \left(\left(\frac{1}{2} \cdot {y}^{4}\right) \cdot \left(x \cdot 1\right)\right)\right) \]
                8. Simplified90.9%

                  \[\leadsto \color{blue}{x \cdot \left(x \cdot \left(0.5 \cdot \left(y \cdot \left(y \cdot \left(y \cdot y\right)\right)\right)\right)\right)} \]
              9. Recombined 2 regimes into one program.
              10. Final simplification87.4%

                \[\leadsto \begin{array}{l} \mathbf{if}\;y \cdot \left(x \cdot y\right) \leq 0.002:\\ \;\;\;\;\frac{1}{1 - x \cdot \left(y \cdot y\right)}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(x \cdot \left(0.5 \cdot \left(y \cdot \left(y \cdot \left(y \cdot y\right)\right)\right)\right)\right)\\ \end{array} \]
              11. Add Preprocessing

              Alternative 8: 82.6% accurate, 5.8× speedup?

              \[\begin{array}{l} \\ \begin{array}{l} t_0 := x \cdot \left(y \cdot y\right)\\ \mathbf{if}\;y \cdot \left(x \cdot y\right) \leq -20000000:\\ \;\;\;\;\frac{1}{1 - t\_0}\\ \mathbf{else}:\\ \;\;\;\;1 + t\_0\\ \end{array} \end{array} \]
              (FPCore (x y)
               :precision binary64
               (let* ((t_0 (* x (* y y))))
                 (if (<= (* y (* x y)) -20000000.0) (/ 1.0 (- 1.0 t_0)) (+ 1.0 t_0))))
              double code(double x, double y) {
              	double t_0 = x * (y * y);
              	double tmp;
              	if ((y * (x * y)) <= -20000000.0) {
              		tmp = 1.0 / (1.0 - t_0);
              	} else {
              		tmp = 1.0 + t_0;
              	}
              	return tmp;
              }
              
              real(8) function code(x, y)
                  real(8), intent (in) :: x
                  real(8), intent (in) :: y
                  real(8) :: t_0
                  real(8) :: tmp
                  t_0 = x * (y * y)
                  if ((y * (x * y)) <= (-20000000.0d0)) then
                      tmp = 1.0d0 / (1.0d0 - t_0)
                  else
                      tmp = 1.0d0 + t_0
                  end if
                  code = tmp
              end function
              
              public static double code(double x, double y) {
              	double t_0 = x * (y * y);
              	double tmp;
              	if ((y * (x * y)) <= -20000000.0) {
              		tmp = 1.0 / (1.0 - t_0);
              	} else {
              		tmp = 1.0 + t_0;
              	}
              	return tmp;
              }
              
              def code(x, y):
              	t_0 = x * (y * y)
              	tmp = 0
              	if (y * (x * y)) <= -20000000.0:
              		tmp = 1.0 / (1.0 - t_0)
              	else:
              		tmp = 1.0 + t_0
              	return tmp
              
              function code(x, y)
              	t_0 = Float64(x * Float64(y * y))
              	tmp = 0.0
              	if (Float64(y * Float64(x * y)) <= -20000000.0)
              		tmp = Float64(1.0 / Float64(1.0 - t_0));
              	else
              		tmp = Float64(1.0 + t_0);
              	end
              	return tmp
              end
              
              function tmp_2 = code(x, y)
              	t_0 = x * (y * y);
              	tmp = 0.0;
              	if ((y * (x * y)) <= -20000000.0)
              		tmp = 1.0 / (1.0 - t_0);
              	else
              		tmp = 1.0 + t_0;
              	end
              	tmp_2 = tmp;
              end
              
              code[x_, y_] := Block[{t$95$0 = N[(x * N[(y * y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(y * N[(x * y), $MachinePrecision]), $MachinePrecision], -20000000.0], N[(1.0 / N[(1.0 - t$95$0), $MachinePrecision]), $MachinePrecision], N[(1.0 + t$95$0), $MachinePrecision]]]
              
              \begin{array}{l}
              
              \\
              \begin{array}{l}
              t_0 := x \cdot \left(y \cdot y\right)\\
              \mathbf{if}\;y \cdot \left(x \cdot y\right) \leq -20000000:\\
              \;\;\;\;\frac{1}{1 - t\_0}\\
              
              \mathbf{else}:\\
              \;\;\;\;1 + t\_0\\
              
              
              \end{array}
              \end{array}
              
              Derivation
              1. Split input into 2 regimes
              2. if (*.f64 (*.f64 x y) y) < -2e7

                1. Initial program 100.0%

                  \[e^{\left(x \cdot y\right) \cdot y} \]
                2. Add Preprocessing
                3. Taylor expanded in x around 0

                  \[\leadsto \color{blue}{1 + x \cdot \left(x \cdot \left(\frac{1}{6} \cdot \left(x \cdot {y}^{6}\right) + \frac{1}{2} \cdot {y}^{4}\right) + {y}^{2}\right)} \]
                4. Simplified1.7%

                  \[\leadsto \color{blue}{1 + \left(x \cdot \left(y \cdot y\right)\right) \cdot \left(1 + \left(x \cdot \left(y \cdot y\right)\right) \cdot \left(0.5 + \left(x \cdot \left(y \cdot y\right)\right) \cdot 0.16666666666666666\right)\right)} \]
                5. Step-by-step derivation
                  1. flip-+N/A

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

                    \[\leadsto \mathsf{/.f64}\left(\left(1 \cdot 1 - \left(\left(x \cdot \left(y \cdot y\right)\right) \cdot \left(1 + \left(x \cdot \left(y \cdot y\right)\right) \cdot \left(\frac{1}{2} + \left(x \cdot \left(y \cdot y\right)\right) \cdot \frac{1}{6}\right)\right)\right) \cdot \left(\left(x \cdot \left(y \cdot y\right)\right) \cdot \left(1 + \left(x \cdot \left(y \cdot y\right)\right) \cdot \left(\frac{1}{2} + \left(x \cdot \left(y \cdot y\right)\right) \cdot \frac{1}{6}\right)\right)\right)\right), \color{blue}{\left(1 - \left(x \cdot \left(y \cdot y\right)\right) \cdot \left(1 + \left(x \cdot \left(y \cdot y\right)\right) \cdot \left(\frac{1}{2} + \left(x \cdot \left(y \cdot y\right)\right) \cdot \frac{1}{6}\right)\right)\right)}\right) \]
                6. Applied egg-rr0.3%

                  \[\leadsto \color{blue}{\frac{1 - \left(1 + \left(x \cdot \left(y \cdot y\right)\right) \cdot \left(0.5 + x \cdot \left(\left(y \cdot y\right) \cdot 0.16666666666666666\right)\right)\right) \cdot \left(\left(x \cdot \left(y \cdot y\right)\right) \cdot \left(x \cdot \left(\left(y \cdot y\right) \cdot \left(1 + \left(x \cdot \left(y \cdot y\right)\right) \cdot \left(0.5 + x \cdot \left(\left(y \cdot y\right) \cdot 0.16666666666666666\right)\right)\right)\right)\right)\right)}{1 - x \cdot \left(\left(y \cdot y\right) \cdot \left(1 + \left(x \cdot \left(y \cdot y\right)\right) \cdot \left(0.5 + x \cdot \left(\left(y \cdot y\right) \cdot 0.16666666666666666\right)\right)\right)\right)}} \]
                7. Taylor expanded in x around 0

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

                    \[\leadsto \frac{\color{blue}{1}}{1 - x \cdot \left(\left(y \cdot y\right) \cdot \left(1 + \left(x \cdot \left(y \cdot y\right)\right) \cdot \left(0.5 + x \cdot \left(\left(y \cdot y\right) \cdot 0.16666666666666666\right)\right)\right)\right)} \]
                  2. Taylor expanded in x around 0

                    \[\leadsto \mathsf{/.f64}\left(1, \color{blue}{\left(1 + -1 \cdot \left(x \cdot {y}^{2}\right)\right)}\right) \]
                  3. Step-by-step derivation
                    1. mul-1-negN/A

                      \[\leadsto \mathsf{/.f64}\left(1, \left(1 + \left(\mathsf{neg}\left(x \cdot {y}^{2}\right)\right)\right)\right) \]
                    2. unsub-negN/A

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

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

                      \[\leadsto \mathsf{/.f64}\left(1, \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(x, \color{blue}{\left({y}^{2}\right)}\right)\right)\right) \]
                    5. unpow2N/A

                      \[\leadsto \mathsf{/.f64}\left(1, \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(x, \left(y \cdot \color{blue}{y}\right)\right)\right)\right) \]
                    6. *-lowering-*.f6458.5%

                      \[\leadsto \mathsf{/.f64}\left(1, \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(y, \color{blue}{y}\right)\right)\right)\right) \]
                  4. Simplified58.5%

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

                  if -2e7 < (*.f64 (*.f64 x y) y)

                  1. Initial program 100.0%

                    \[e^{\left(x \cdot y\right) \cdot y} \]
                  2. Add Preprocessing
                  3. Taylor expanded in x around 0

                    \[\leadsto \color{blue}{1 + x \cdot {y}^{2}} \]
                  4. Step-by-step derivation
                    1. +-lowering-+.f64N/A

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

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

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

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

                    \[\leadsto \color{blue}{1 + x \cdot \left(y \cdot y\right)} \]
                9. Recombined 2 regimes into one program.
                10. Final simplification82.5%

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

                Alternative 9: 66.6% accurate, 7.5× speedup?

                \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \cdot \left(x \cdot y\right) \leq 0.002:\\ \;\;\;\;1\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(y \cdot y\right)\\ \end{array} \end{array} \]
                (FPCore (x y)
                 :precision binary64
                 (if (<= (* y (* x y)) 0.002) 1.0 (* x (* y y))))
                double code(double x, double y) {
                	double tmp;
                	if ((y * (x * y)) <= 0.002) {
                		tmp = 1.0;
                	} else {
                		tmp = x * (y * y);
                	}
                	return tmp;
                }
                
                real(8) function code(x, y)
                    real(8), intent (in) :: x
                    real(8), intent (in) :: y
                    real(8) :: tmp
                    if ((y * (x * y)) <= 0.002d0) then
                        tmp = 1.0d0
                    else
                        tmp = x * (y * y)
                    end if
                    code = tmp
                end function
                
                public static double code(double x, double y) {
                	double tmp;
                	if ((y * (x * y)) <= 0.002) {
                		tmp = 1.0;
                	} else {
                		tmp = x * (y * y);
                	}
                	return tmp;
                }
                
                def code(x, y):
                	tmp = 0
                	if (y * (x * y)) <= 0.002:
                		tmp = 1.0
                	else:
                		tmp = x * (y * y)
                	return tmp
                
                function code(x, y)
                	tmp = 0.0
                	if (Float64(y * Float64(x * y)) <= 0.002)
                		tmp = 1.0;
                	else
                		tmp = Float64(x * Float64(y * y));
                	end
                	return tmp
                end
                
                function tmp_2 = code(x, y)
                	tmp = 0.0;
                	if ((y * (x * y)) <= 0.002)
                		tmp = 1.0;
                	else
                		tmp = x * (y * y);
                	end
                	tmp_2 = tmp;
                end
                
                code[x_, y_] := If[LessEqual[N[(y * N[(x * y), $MachinePrecision]), $MachinePrecision], 0.002], 1.0, N[(x * N[(y * y), $MachinePrecision]), $MachinePrecision]]
                
                \begin{array}{l}
                
                \\
                \begin{array}{l}
                \mathbf{if}\;y \cdot \left(x \cdot y\right) \leq 0.002:\\
                \;\;\;\;1\\
                
                \mathbf{else}:\\
                \;\;\;\;x \cdot \left(y \cdot y\right)\\
                
                
                \end{array}
                \end{array}
                
                Derivation
                1. Split input into 2 regimes
                2. if (*.f64 (*.f64 x y) y) < 2e-3

                  1. Initial program 100.0%

                    \[e^{\left(x \cdot y\right) \cdot y} \]
                  2. Add Preprocessing
                  3. Applied egg-rr68.7%

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

                  if 2e-3 < (*.f64 (*.f64 x y) y)

                  1. Initial program 100.0%

                    \[e^{\left(x \cdot y\right) \cdot y} \]
                  2. Add Preprocessing
                  3. Taylor expanded in x around 0

                    \[\leadsto \color{blue}{1 + x \cdot {y}^{2}} \]
                  4. Step-by-step derivation
                    1. +-lowering-+.f64N/A

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

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

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

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

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

                    \[\leadsto \color{blue}{x \cdot {y}^{2}} \]
                  7. Step-by-step derivation
                    1. *-lowering-*.f64N/A

                      \[\leadsto \mathsf{*.f64}\left(x, \color{blue}{\left({y}^{2}\right)}\right) \]
                    2. unpow2N/A

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

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

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

                  \[\leadsto \begin{array}{l} \mathbf{if}\;y \cdot \left(x \cdot y\right) \leq 0.002:\\ \;\;\;\;1\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(y \cdot y\right)\\ \end{array} \]
                5. Add Preprocessing

                Alternative 10: 66.6% accurate, 15.0× speedup?

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

                  \[e^{\left(x \cdot y\right) \cdot y} \]
                2. Add Preprocessing
                3. Taylor expanded in x around 0

                  \[\leadsto \color{blue}{1 + x \cdot {y}^{2}} \]
                4. Step-by-step derivation
                  1. +-lowering-+.f64N/A

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

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

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

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

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

                Alternative 11: 51.2% accurate, 105.0× speedup?

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

                  \[e^{\left(x \cdot y\right) \cdot y} \]
                2. Add Preprocessing
                3. Applied egg-rr55.4%

                  \[\leadsto \color{blue}{1} \]
                4. Add Preprocessing

                Reproduce

                ?
                herbie shell --seed 2024191 
                (FPCore (x y)
                  :name "Data.Random.Distribution.Normal:normalF from random-fu-0.2.6.2"
                  :precision binary64
                  (exp (* (* x y) y)))