Linear.Quaternion:$cexp from linear-1.19.1.3

Percentage Accurate: 99.8% → 99.8%
Time: 10.9s
Alternatives: 7
Speedup: 1.0×

Specification

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

\\
x \cdot \frac{\sin y}{y}
\end{array}

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 7 alternatives:

AlternativeAccuracySpeedup
The accuracy (vertical axis) and speed (horizontal axis) of each alternatives. Up and to the right is better. The red square shows the initial program, and each blue circle shows an alternative.The line shows the best available speed-accuracy tradeoffs.

Initial Program: 99.8% accurate, 1.0× speedup?

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

\\
x \cdot \frac{\sin y}{y}
\end{array}

Alternative 1: 99.8% accurate, 1.0× speedup?

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

\\
x \cdot \frac{\sin y}{y}
\end{array}
Derivation
  1. Initial program 99.8%

    \[x \cdot \frac{\sin y}{y} \]
  2. Add Preprocessing
  3. Add Preprocessing

Alternative 2: 56.8% accurate, 7.5× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < 3.2e5

    1. Initial program 99.9%

      \[x \cdot \frac{\sin y}{y} \]
    2. Add Preprocessing
    3. Taylor expanded in y around 0

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

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

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

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

        \[\leadsto x \cdot 1 + x \cdot \left(\frac{-1}{6} \cdot \color{blue}{{y}^{2}}\right) \]
      5. distribute-lft-inN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(y, \mathsf{*.f64}\left(\mathsf{*.f64}\left(y, \frac{-1}{6}\right), x\right)\right), x\right) \]
    9. Applied egg-rr67.2%

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

    if 3.2e5 < y

    1. Initial program 99.6%

      \[x \cdot \frac{\sin y}{y} \]
    2. Add Preprocessing
    3. Taylor expanded in y around 0

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

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

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

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

        \[\leadsto x \cdot 1 + x \cdot \left(\frac{-1}{6} \cdot \color{blue}{{y}^{2}}\right) \]
      5. distribute-lft-inN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{\_.f64}\left(1, \left(\left(\frac{-1}{6} \cdot \left(y \cdot y\right)\right) \cdot \left(\frac{-1}{6} \cdot \left(y \cdot y\right)\right)\right)\right), x\right), \left(1 - \frac{-1}{6} \cdot \left(y \cdot y\right)\right)\right) \]
      8. swap-sqrN/A

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

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

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

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

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\frac{1}{36}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(y, y\right), \mathsf{*.f64}\left(y, y\right)\right)\right)\right), x\right), \left(1 - \frac{-1}{6} \cdot \left(y \cdot y\right)\right)\right) \]
      14. cancel-sign-sub-invN/A

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{x}{\color{blue}{0.16666666666666666 \cdot \left(y \cdot y\right)}} \]
    10. Recombined 2 regimes into one program.
    11. Final simplification60.1%

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

    Alternative 3: 56.8% accurate, 7.5× speedup?

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

      1. Initial program 99.9%

        \[x \cdot \frac{\sin y}{y} \]
      2. Add Preprocessing
      3. Taylor expanded in y around 0

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

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

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

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

          \[\leadsto x \cdot 1 + x \cdot \left(\frac{-1}{6} \cdot \color{blue}{{y}^{2}}\right) \]
        5. distribute-lft-inN/A

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

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

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

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

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

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

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

      if 3.2e5 < y

      1. Initial program 99.6%

        \[x \cdot \frac{\sin y}{y} \]
      2. Add Preprocessing
      3. Taylor expanded in y around 0

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

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

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

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

          \[\leadsto x \cdot 1 + x \cdot \left(\frac{-1}{6} \cdot \color{blue}{{y}^{2}}\right) \]
        5. distribute-lft-inN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{\_.f64}\left(1, \left(\left(\frac{-1}{6} \cdot \left(y \cdot y\right)\right) \cdot \left(\frac{-1}{6} \cdot \left(y \cdot y\right)\right)\right)\right), x\right), \left(1 - \frac{-1}{6} \cdot \left(y \cdot y\right)\right)\right) \]
        8. swap-sqrN/A

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

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

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

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

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

          \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\frac{1}{36}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(y, y\right), \mathsf{*.f64}\left(y, y\right)\right)\right)\right), x\right), \left(1 - \frac{-1}{6} \cdot \left(y \cdot y\right)\right)\right) \]
        14. cancel-sign-sub-invN/A

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \frac{x}{\color{blue}{0.16666666666666666 \cdot \left(y \cdot y\right)}} \]
      10. Recombined 2 regimes into one program.
      11. Final simplification60.1%

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

      Alternative 4: 57.1% accurate, 8.7× speedup?

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

        1. Initial program 99.9%

          \[x \cdot \frac{\sin y}{y} \]
        2. Add Preprocessing
        3. Taylor expanded in y around 0

          \[\leadsto \color{blue}{x} \]
        4. Step-by-step derivation
          1. Simplified67.7%

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

          if 2.5 < y

          1. Initial program 99.6%

            \[x \cdot \frac{\sin y}{y} \]
          2. Add Preprocessing
          3. Taylor expanded in y around 0

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

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

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

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

              \[\leadsto x \cdot 1 + x \cdot \left(\frac{-1}{6} \cdot \color{blue}{{y}^{2}}\right) \]
            5. distribute-lft-inN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

              \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{\_.f64}\left(1, \left(\left(\frac{-1}{6} \cdot \left(y \cdot y\right)\right) \cdot \left(\frac{-1}{6} \cdot \left(y \cdot y\right)\right)\right)\right), x\right), \left(1 - \frac{-1}{6} \cdot \left(y \cdot y\right)\right)\right) \]
            8. swap-sqrN/A

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

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

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

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

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

              \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\frac{1}{36}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(y, y\right), \mathsf{*.f64}\left(y, y\right)\right)\right)\right), x\right), \left(1 - \frac{-1}{6} \cdot \left(y \cdot y\right)\right)\right) \]
            14. cancel-sign-sub-invN/A

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

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

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

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

              \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\frac{1}{36}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(y, y\right), \mathsf{*.f64}\left(y, y\right)\right)\right)\right), x\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{1}{6}, \mathsf{*.f64}\left(y, \color{blue}{y}\right)\right)\right)\right) \]
          7. Applied egg-rr1.4%

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

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

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

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

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

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

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

              \[\leadsto \frac{x}{\color{blue}{0.16666666666666666 \cdot \left(y \cdot y\right)}} \]
          10. Recombined 2 regimes into one program.
          11. Add Preprocessing

          Alternative 5: 62.7% accurate, 11.7× speedup?

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

            \[x \cdot \frac{\sin y}{y} \]
          2. Add Preprocessing
          3. Taylor expanded in y around 0

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

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

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

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

              \[\leadsto x \cdot 1 + x \cdot \left(\frac{-1}{6} \cdot \color{blue}{{y}^{2}}\right) \]
            5. distribute-lft-inN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

              \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{\_.f64}\left(1, \left(\left(\frac{-1}{6} \cdot \left(y \cdot y\right)\right) \cdot \left(\frac{-1}{6} \cdot \left(y \cdot y\right)\right)\right)\right), x\right), \left(1 - \frac{-1}{6} \cdot \left(y \cdot y\right)\right)\right) \]
            8. swap-sqrN/A

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

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

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

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

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

              \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\frac{1}{36}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(y, y\right), \mathsf{*.f64}\left(y, y\right)\right)\right)\right), x\right), \left(1 - \frac{-1}{6} \cdot \left(y \cdot y\right)\right)\right) \]
            14. cancel-sign-sub-invN/A

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

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

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

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

              \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\frac{1}{36}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(y, y\right), \mathsf{*.f64}\left(y, y\right)\right)\right)\right), x\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{1}{6}, \mathsf{*.f64}\left(y, \color{blue}{y}\right)\right)\right)\right) \]
          7. Applied egg-rr50.8%

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

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

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

            Alternative 6: 56.9% accurate, 17.5× speedup?

            \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq 1.46 \cdot 10^{+44}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;0\\ \end{array} \end{array} \]
            (FPCore (x y) :precision binary64 (if (<= y 1.46e+44) x 0.0))
            double code(double x, double y) {
            	double tmp;
            	if (y <= 1.46e+44) {
            		tmp = x;
            	} else {
            		tmp = 0.0;
            	}
            	return tmp;
            }
            
            real(8) function code(x, y)
                real(8), intent (in) :: x
                real(8), intent (in) :: y
                real(8) :: tmp
                if (y <= 1.46d+44) then
                    tmp = x
                else
                    tmp = 0.0d0
                end if
                code = tmp
            end function
            
            public static double code(double x, double y) {
            	double tmp;
            	if (y <= 1.46e+44) {
            		tmp = x;
            	} else {
            		tmp = 0.0;
            	}
            	return tmp;
            }
            
            def code(x, y):
            	tmp = 0
            	if y <= 1.46e+44:
            		tmp = x
            	else:
            		tmp = 0.0
            	return tmp
            
            function code(x, y)
            	tmp = 0.0
            	if (y <= 1.46e+44)
            		tmp = x;
            	else
            		tmp = 0.0;
            	end
            	return tmp
            end
            
            function tmp_2 = code(x, y)
            	tmp = 0.0;
            	if (y <= 1.46e+44)
            		tmp = x;
            	else
            		tmp = 0.0;
            	end
            	tmp_2 = tmp;
            end
            
            code[x_, y_] := If[LessEqual[y, 1.46e+44], x, 0.0]
            
            \begin{array}{l}
            
            \\
            \begin{array}{l}
            \mathbf{if}\;y \leq 1.46 \cdot 10^{+44}:\\
            \;\;\;\;x\\
            
            \mathbf{else}:\\
            \;\;\;\;0\\
            
            
            \end{array}
            \end{array}
            
            Derivation
            1. Split input into 2 regimes
            2. if y < 1.4599999999999999e44

              1. Initial program 99.8%

                \[x \cdot \frac{\sin y}{y} \]
              2. Add Preprocessing
              3. Taylor expanded in y around 0

                \[\leadsto \color{blue}{x} \]
              4. Step-by-step derivation
                1. Simplified65.2%

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

                if 1.4599999999999999e44 < y

                1. Initial program 99.7%

                  \[x \cdot \frac{\sin y}{y} \]
                2. Add Preprocessing
                3. Applied egg-rr41.8%

                  \[\leadsto \color{blue}{0} \]
              5. Recombined 2 regimes into one program.
              6. Add Preprocessing

              Alternative 7: 15.2% accurate, 105.0× speedup?

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

                \[x \cdot \frac{\sin y}{y} \]
              2. Add Preprocessing
              3. Applied egg-rr18.2%

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

              Reproduce

              ?
              herbie shell --seed 2024158 
              (FPCore (x y)
                :name "Linear.Quaternion:$cexp from linear-1.19.1.3"
                :precision binary64
                (* x (/ (sin y) y)))