Linear.Quaternion:$cexp from linear-1.19.1.3

Percentage Accurate: 99.8% → 99.8%
Time: 8.7s
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.1% accurate, 7.5× speedup?

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

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

\mathbf{else}:\\
\;\;\;\;\frac{\frac{x \cdot 6}{y}}{y}\\


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

    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. *-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 260 < 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. *-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\left(\mathsf{neg}\left(-1\right)\right) \cdot \left(x \cdot y\right)}{\frac{\color{blue}{1 - y \cdot \left(y \cdot \frac{-1}{6}\right)}}{1 \cdot 1 - \left(y \cdot \left(y \cdot \frac{-1}{6}\right)\right) \cdot \left(y \cdot \left(y \cdot \frac{-1}{6}\right)\right)} \cdot y} \]
      9. distribute-lft-neg-inN/A

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

        \[\leadsto \frac{\mathsf{neg}\left(\left(\mathsf{neg}\left(x \cdot y\right)\right)\right)}{\frac{\color{blue}{1 - y \cdot \left(y \cdot \frac{-1}{6}\right)}}{1 \cdot 1 - \left(y \cdot \left(y \cdot \frac{-1}{6}\right)\right) \cdot \left(y \cdot \left(y \cdot \frac{-1}{6}\right)\right)} \cdot y} \]
      11. remove-double-negN/A

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(x, y\right), \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(y, \mathsf{*.f64}\left(y, \frac{1}{6}\right)\right)\right), y\right)\right) \]
    10. Simplified32.1%

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

      \[\leadsto \color{blue}{6 \cdot \frac{x}{{y}^{2}}} \]
    12. Step-by-step derivation
      1. associate-*r/N/A

        \[\leadsto \frac{6 \cdot x}{\color{blue}{{y}^{2}}} \]
      2. unpow2N/A

        \[\leadsto \frac{6 \cdot x}{y \cdot \color{blue}{y}} \]
      3. associate-/r*N/A

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

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

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(x \cdot 6\right), y\right), y\right) \]
      7. *-lowering-*.f6432.9%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(x, 6\right), y\right), y\right) \]
    13. Simplified32.9%

      \[\leadsto \color{blue}{\frac{\frac{x \cdot 6}{y}}{y}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification60.9%

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

Alternative 3: 56.1% accurate, 7.5× speedup?

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

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

\mathbf{else}:\\
\;\;\;\;\frac{\frac{x \cdot 6}{y}}{y}\\


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

    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. *-commutativeN/A

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

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

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

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

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

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

    if 260 < 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. *-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\left(\mathsf{neg}\left(-1\right)\right) \cdot \left(x \cdot y\right)}{\frac{\color{blue}{1 - y \cdot \left(y \cdot \frac{-1}{6}\right)}}{1 \cdot 1 - \left(y \cdot \left(y \cdot \frac{-1}{6}\right)\right) \cdot \left(y \cdot \left(y \cdot \frac{-1}{6}\right)\right)} \cdot y} \]
      9. distribute-lft-neg-inN/A

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

        \[\leadsto \frac{\mathsf{neg}\left(\left(\mathsf{neg}\left(x \cdot y\right)\right)\right)}{\frac{\color{blue}{1 - y \cdot \left(y \cdot \frac{-1}{6}\right)}}{1 \cdot 1 - \left(y \cdot \left(y \cdot \frac{-1}{6}\right)\right) \cdot \left(y \cdot \left(y \cdot \frac{-1}{6}\right)\right)} \cdot y} \]
      11. remove-double-negN/A

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(x, y\right), \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(y, \mathsf{*.f64}\left(y, \frac{1}{6}\right)\right)\right), y\right)\right) \]
    10. Simplified32.1%

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

      \[\leadsto \color{blue}{6 \cdot \frac{x}{{y}^{2}}} \]
    12. Step-by-step derivation
      1. associate-*r/N/A

        \[\leadsto \frac{6 \cdot x}{\color{blue}{{y}^{2}}} \]
      2. unpow2N/A

        \[\leadsto \frac{6 \cdot x}{y \cdot \color{blue}{y}} \]
      3. associate-/r*N/A

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

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

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(x \cdot 6\right), y\right), y\right) \]
      7. *-lowering-*.f6432.9%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(x, 6\right), y\right), y\right) \]
    13. Simplified32.9%

      \[\leadsto \color{blue}{\frac{\frac{x \cdot 6}{y}}{y}} \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 4: 56.4% accurate, 8.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq 2.4:\\
\;\;\;\;x\\

\mathbf{else}:\\
\;\;\;\;\frac{\frac{x \cdot 6}{y}}{y}\\


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

    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. Simplified68.6%

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

      if 2.39999999999999991 < 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. *-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \frac{\left(\mathsf{neg}\left(-1\right)\right) \cdot \left(x \cdot y\right)}{\frac{\color{blue}{1 - y \cdot \left(y \cdot \frac{-1}{6}\right)}}{1 \cdot 1 - \left(y \cdot \left(y \cdot \frac{-1}{6}\right)\right) \cdot \left(y \cdot \left(y \cdot \frac{-1}{6}\right)\right)} \cdot y} \]
        9. distribute-lft-neg-inN/A

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

          \[\leadsto \frac{\mathsf{neg}\left(\left(\mathsf{neg}\left(x \cdot y\right)\right)\right)}{\frac{\color{blue}{1 - y \cdot \left(y \cdot \frac{-1}{6}\right)}}{1 \cdot 1 - \left(y \cdot \left(y \cdot \frac{-1}{6}\right)\right) \cdot \left(y \cdot \left(y \cdot \frac{-1}{6}\right)\right)} \cdot y} \]
        11. remove-double-negN/A

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(x, y\right), \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(y, \mathsf{*.f64}\left(y, \frac{1}{6}\right)\right)\right), y\right)\right) \]
      10. Simplified32.1%

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

        \[\leadsto \color{blue}{6 \cdot \frac{x}{{y}^{2}}} \]
      12. Step-by-step derivation
        1. associate-*r/N/A

          \[\leadsto \frac{6 \cdot x}{\color{blue}{{y}^{2}}} \]
        2. unpow2N/A

          \[\leadsto \frac{6 \cdot x}{y \cdot \color{blue}{y}} \]
        3. associate-/r*N/A

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

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

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

          \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(x \cdot 6\right), y\right), y\right) \]
        7. *-lowering-*.f6432.9%

          \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(x, 6\right), y\right), y\right) \]
      13. Simplified32.9%

        \[\leadsto \color{blue}{\frac{\frac{x \cdot 6}{y}}{y}} \]
    5. Recombined 2 regimes into one program.
    6. Add Preprocessing

    Alternative 5: 62.6% accurate, 11.7× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\left(\mathsf{neg}\left(-1\right)\right) \cdot \left(x \cdot y\right)}{\frac{\color{blue}{1 - y \cdot \left(y \cdot \frac{-1}{6}\right)}}{1 \cdot 1 - \left(y \cdot \left(y \cdot \frac{-1}{6}\right)\right) \cdot \left(y \cdot \left(y \cdot \frac{-1}{6}\right)\right)} \cdot y} \]
      9. distribute-lft-neg-inN/A

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

        \[\leadsto \frac{\mathsf{neg}\left(\left(\mathsf{neg}\left(x \cdot y\right)\right)\right)}{\frac{\color{blue}{1 - y \cdot \left(y \cdot \frac{-1}{6}\right)}}{1 \cdot 1 - \left(y \cdot \left(y \cdot \frac{-1}{6}\right)\right) \cdot \left(y \cdot \left(y \cdot \frac{-1}{6}\right)\right)} \cdot y} \]
      11. remove-double-negN/A

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(x, y\right), \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(y, \mathsf{*.f64}\left(y, \frac{1}{6}\right)\right)\right), y\right)\right) \]
    10. Simplified51.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{/.f64}\left(x, \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(y, \mathsf{*.f64}\left(y, \color{blue}{\frac{-1}{6}}\right)\right)\right)\right) \]
    13. Simplified66.0%

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

    Alternative 6: 56.3% accurate, 17.5× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq 5.8 \cdot 10^{+18}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;0\\ \end{array} \end{array} \]
    (FPCore (x y) :precision binary64 (if (<= y 5.8e+18) x 0.0))
    double code(double x, double y) {
    	double tmp;
    	if (y <= 5.8e+18) {
    		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 <= 5.8d+18) 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 <= 5.8e+18) {
    		tmp = x;
    	} else {
    		tmp = 0.0;
    	}
    	return tmp;
    }
    
    def code(x, y):
    	tmp = 0
    	if y <= 5.8e+18:
    		tmp = x
    	else:
    		tmp = 0.0
    	return tmp
    
    function code(x, y)
    	tmp = 0.0
    	if (y <= 5.8e+18)
    		tmp = x;
    	else
    		tmp = 0.0;
    	end
    	return tmp
    end
    
    function tmp_2 = code(x, y)
    	tmp = 0.0;
    	if (y <= 5.8e+18)
    		tmp = x;
    	else
    		tmp = 0.0;
    	end
    	tmp_2 = tmp;
    end
    
    code[x_, y_] := If[LessEqual[y, 5.8e+18], x, 0.0]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    \mathbf{if}\;y \leq 5.8 \cdot 10^{+18}:\\
    \;\;\;\;x\\
    
    \mathbf{else}:\\
    \;\;\;\;0\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if y < 5.8e18

      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.8%

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

        if 5.8e18 < y

        1. Initial program 99.6%

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

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

      Alternative 7: 15.7% 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-rr14.6%

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

      Reproduce

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