Diagrams.TwoD.Path.Metafont.Internal:hobbyF from diagrams-contrib-1.3.0.5

Percentage Accurate: 99.3% → 99.4%
Time: 26.2s
Alternatives: 40
Speedup: 1.0×

Specification

?
\[\begin{array}{l} \\ \frac{2 + \left(\left(\sqrt{2} \cdot \left(\sin x - \frac{\sin y}{16}\right)\right) \cdot \left(\sin y - \frac{\sin x}{16}\right)\right) \cdot \left(\cos x - \cos y\right)}{3 \cdot \left(\left(1 + \frac{\sqrt{5} - 1}{2} \cdot \cos x\right) + \frac{3 - \sqrt{5}}{2} \cdot \cos y\right)} \end{array} \]
(FPCore (x y)
 :precision binary64
 (/
  (+
   2.0
   (*
    (*
     (* (sqrt 2.0) (- (sin x) (/ (sin y) 16.0)))
     (- (sin y) (/ (sin x) 16.0)))
    (- (cos x) (cos y))))
  (*
   3.0
   (+
    (+ 1.0 (* (/ (- (sqrt 5.0) 1.0) 2.0) (cos x)))
    (* (/ (- 3.0 (sqrt 5.0)) 2.0) (cos y))))))
double code(double x, double y) {
	return (2.0 + (((sqrt(2.0) * (sin(x) - (sin(y) / 16.0))) * (sin(y) - (sin(x) / 16.0))) * (cos(x) - cos(y)))) / (3.0 * ((1.0 + (((sqrt(5.0) - 1.0) / 2.0) * cos(x))) + (((3.0 - sqrt(5.0)) / 2.0) * cos(y))));
}
real(8) function code(x, y)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    code = (2.0d0 + (((sqrt(2.0d0) * (sin(x) - (sin(y) / 16.0d0))) * (sin(y) - (sin(x) / 16.0d0))) * (cos(x) - cos(y)))) / (3.0d0 * ((1.0d0 + (((sqrt(5.0d0) - 1.0d0) / 2.0d0) * cos(x))) + (((3.0d0 - sqrt(5.0d0)) / 2.0d0) * cos(y))))
end function
public static double code(double x, double y) {
	return (2.0 + (((Math.sqrt(2.0) * (Math.sin(x) - (Math.sin(y) / 16.0))) * (Math.sin(y) - (Math.sin(x) / 16.0))) * (Math.cos(x) - Math.cos(y)))) / (3.0 * ((1.0 + (((Math.sqrt(5.0) - 1.0) / 2.0) * Math.cos(x))) + (((3.0 - Math.sqrt(5.0)) / 2.0) * Math.cos(y))));
}
def code(x, y):
	return (2.0 + (((math.sqrt(2.0) * (math.sin(x) - (math.sin(y) / 16.0))) * (math.sin(y) - (math.sin(x) / 16.0))) * (math.cos(x) - math.cos(y)))) / (3.0 * ((1.0 + (((math.sqrt(5.0) - 1.0) / 2.0) * math.cos(x))) + (((3.0 - math.sqrt(5.0)) / 2.0) * math.cos(y))))
function code(x, y)
	return Float64(Float64(2.0 + Float64(Float64(Float64(sqrt(2.0) * Float64(sin(x) - Float64(sin(y) / 16.0))) * Float64(sin(y) - Float64(sin(x) / 16.0))) * Float64(cos(x) - cos(y)))) / Float64(3.0 * Float64(Float64(1.0 + Float64(Float64(Float64(sqrt(5.0) - 1.0) / 2.0) * cos(x))) + Float64(Float64(Float64(3.0 - sqrt(5.0)) / 2.0) * cos(y)))))
end
function tmp = code(x, y)
	tmp = (2.0 + (((sqrt(2.0) * (sin(x) - (sin(y) / 16.0))) * (sin(y) - (sin(x) / 16.0))) * (cos(x) - cos(y)))) / (3.0 * ((1.0 + (((sqrt(5.0) - 1.0) / 2.0) * cos(x))) + (((3.0 - sqrt(5.0)) / 2.0) * cos(y))));
end
code[x_, y_] := N[(N[(2.0 + N[(N[(N[(N[Sqrt[2.0], $MachinePrecision] * N[(N[Sin[x], $MachinePrecision] - N[(N[Sin[y], $MachinePrecision] / 16.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[Sin[y], $MachinePrecision] - N[(N[Sin[x], $MachinePrecision] / 16.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[Cos[x], $MachinePrecision] - N[Cos[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(3.0 * N[(N[(1.0 + N[(N[(N[(N[Sqrt[5.0], $MachinePrecision] - 1.0), $MachinePrecision] / 2.0), $MachinePrecision] * N[Cos[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(3.0 - N[Sqrt[5.0], $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision] * N[Cos[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\frac{2 + \left(\left(\sqrt{2} \cdot \left(\sin x - \frac{\sin y}{16}\right)\right) \cdot \left(\sin y - \frac{\sin x}{16}\right)\right) \cdot \left(\cos x - \cos y\right)}{3 \cdot \left(\left(1 + \frac{\sqrt{5} - 1}{2} \cdot \cos x\right) + \frac{3 - \sqrt{5}}{2} \cdot \cos y\right)}
\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 40 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.3% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \frac{2 + \left(\left(\sqrt{2} \cdot \left(\sin x - \frac{\sin y}{16}\right)\right) \cdot \left(\sin y - \frac{\sin x}{16}\right)\right) \cdot \left(\cos x - \cos y\right)}{3 \cdot \left(\left(1 + \frac{\sqrt{5} - 1}{2} \cdot \cos x\right) + \frac{3 - \sqrt{5}}{2} \cdot \cos y\right)} \end{array} \]
(FPCore (x y)
 :precision binary64
 (/
  (+
   2.0
   (*
    (*
     (* (sqrt 2.0) (- (sin x) (/ (sin y) 16.0)))
     (- (sin y) (/ (sin x) 16.0)))
    (- (cos x) (cos y))))
  (*
   3.0
   (+
    (+ 1.0 (* (/ (- (sqrt 5.0) 1.0) 2.0) (cos x)))
    (* (/ (- 3.0 (sqrt 5.0)) 2.0) (cos y))))))
double code(double x, double y) {
	return (2.0 + (((sqrt(2.0) * (sin(x) - (sin(y) / 16.0))) * (sin(y) - (sin(x) / 16.0))) * (cos(x) - cos(y)))) / (3.0 * ((1.0 + (((sqrt(5.0) - 1.0) / 2.0) * cos(x))) + (((3.0 - sqrt(5.0)) / 2.0) * cos(y))));
}
real(8) function code(x, y)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    code = (2.0d0 + (((sqrt(2.0d0) * (sin(x) - (sin(y) / 16.0d0))) * (sin(y) - (sin(x) / 16.0d0))) * (cos(x) - cos(y)))) / (3.0d0 * ((1.0d0 + (((sqrt(5.0d0) - 1.0d0) / 2.0d0) * cos(x))) + (((3.0d0 - sqrt(5.0d0)) / 2.0d0) * cos(y))))
end function
public static double code(double x, double y) {
	return (2.0 + (((Math.sqrt(2.0) * (Math.sin(x) - (Math.sin(y) / 16.0))) * (Math.sin(y) - (Math.sin(x) / 16.0))) * (Math.cos(x) - Math.cos(y)))) / (3.0 * ((1.0 + (((Math.sqrt(5.0) - 1.0) / 2.0) * Math.cos(x))) + (((3.0 - Math.sqrt(5.0)) / 2.0) * Math.cos(y))));
}
def code(x, y):
	return (2.0 + (((math.sqrt(2.0) * (math.sin(x) - (math.sin(y) / 16.0))) * (math.sin(y) - (math.sin(x) / 16.0))) * (math.cos(x) - math.cos(y)))) / (3.0 * ((1.0 + (((math.sqrt(5.0) - 1.0) / 2.0) * math.cos(x))) + (((3.0 - math.sqrt(5.0)) / 2.0) * math.cos(y))))
function code(x, y)
	return Float64(Float64(2.0 + Float64(Float64(Float64(sqrt(2.0) * Float64(sin(x) - Float64(sin(y) / 16.0))) * Float64(sin(y) - Float64(sin(x) / 16.0))) * Float64(cos(x) - cos(y)))) / Float64(3.0 * Float64(Float64(1.0 + Float64(Float64(Float64(sqrt(5.0) - 1.0) / 2.0) * cos(x))) + Float64(Float64(Float64(3.0 - sqrt(5.0)) / 2.0) * cos(y)))))
end
function tmp = code(x, y)
	tmp = (2.0 + (((sqrt(2.0) * (sin(x) - (sin(y) / 16.0))) * (sin(y) - (sin(x) / 16.0))) * (cos(x) - cos(y)))) / (3.0 * ((1.0 + (((sqrt(5.0) - 1.0) / 2.0) * cos(x))) + (((3.0 - sqrt(5.0)) / 2.0) * cos(y))));
end
code[x_, y_] := N[(N[(2.0 + N[(N[(N[(N[Sqrt[2.0], $MachinePrecision] * N[(N[Sin[x], $MachinePrecision] - N[(N[Sin[y], $MachinePrecision] / 16.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[Sin[y], $MachinePrecision] - N[(N[Sin[x], $MachinePrecision] / 16.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[Cos[x], $MachinePrecision] - N[Cos[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(3.0 * N[(N[(1.0 + N[(N[(N[(N[Sqrt[5.0], $MachinePrecision] - 1.0), $MachinePrecision] / 2.0), $MachinePrecision] * N[Cos[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(3.0 - N[Sqrt[5.0], $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision] * N[Cos[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\frac{2 + \left(\left(\sqrt{2} \cdot \left(\sin x - \frac{\sin y}{16}\right)\right) \cdot \left(\sin y - \frac{\sin x}{16}\right)\right) \cdot \left(\cos x - \cos y\right)}{3 \cdot \left(\left(1 + \frac{\sqrt{5} - 1}{2} \cdot \cos x\right) + \frac{3 - \sqrt{5}}{2} \cdot \cos y\right)}
\end{array}

Alternative 1: 99.4% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \frac{\mathsf{fma}\left(\left(\cos x - \cos y\right) \cdot \mathsf{fma}\left(-0.0625, \sin y, \sin x\right), \mathsf{fma}\left(-0.0625, \sin x, \sin y\right) \cdot \sqrt{2}, 2\right)}{\mathsf{fma}\left(3, \mathsf{fma}\left(\mathsf{fma}\left(0.5, \sqrt{5}, -0.5\right), \cos x, \frac{\cos y}{\mathsf{fma}\left(0.5, \sqrt{5}, 1.5\right)}\right), 3\right)} \end{array} \]
(FPCore (x y)
 :precision binary64
 (/
  (fma
   (* (- (cos x) (cos y)) (fma -0.0625 (sin y) (sin x)))
   (* (fma -0.0625 (sin x) (sin y)) (sqrt 2.0))
   2.0)
  (fma
   3.0
   (fma (fma 0.5 (sqrt 5.0) -0.5) (cos x) (/ (cos y) (fma 0.5 (sqrt 5.0) 1.5)))
   3.0)))
double code(double x, double y) {
	return fma(((cos(x) - cos(y)) * fma(-0.0625, sin(y), sin(x))), (fma(-0.0625, sin(x), sin(y)) * sqrt(2.0)), 2.0) / fma(3.0, fma(fma(0.5, sqrt(5.0), -0.5), cos(x), (cos(y) / fma(0.5, sqrt(5.0), 1.5))), 3.0);
}
function code(x, y)
	return Float64(fma(Float64(Float64(cos(x) - cos(y)) * fma(-0.0625, sin(y), sin(x))), Float64(fma(-0.0625, sin(x), sin(y)) * sqrt(2.0)), 2.0) / fma(3.0, fma(fma(0.5, sqrt(5.0), -0.5), cos(x), Float64(cos(y) / fma(0.5, sqrt(5.0), 1.5))), 3.0))
end
code[x_, y_] := N[(N[(N[(N[(N[Cos[x], $MachinePrecision] - N[Cos[y], $MachinePrecision]), $MachinePrecision] * N[(-0.0625 * N[Sin[y], $MachinePrecision] + N[Sin[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(-0.0625 * N[Sin[x], $MachinePrecision] + N[Sin[y], $MachinePrecision]), $MachinePrecision] * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision] + 2.0), $MachinePrecision] / N[(3.0 * N[(N[(0.5 * N[Sqrt[5.0], $MachinePrecision] + -0.5), $MachinePrecision] * N[Cos[x], $MachinePrecision] + N[(N[Cos[y], $MachinePrecision] / N[(0.5 * N[Sqrt[5.0], $MachinePrecision] + 1.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 3.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\frac{\mathsf{fma}\left(\left(\cos x - \cos y\right) \cdot \mathsf{fma}\left(-0.0625, \sin y, \sin x\right), \mathsf{fma}\left(-0.0625, \sin x, \sin y\right) \cdot \sqrt{2}, 2\right)}{\mathsf{fma}\left(3, \mathsf{fma}\left(\mathsf{fma}\left(0.5, \sqrt{5}, -0.5\right), \cos x, \frac{\cos y}{\mathsf{fma}\left(0.5, \sqrt{5}, 1.5\right)}\right), 3\right)}
\end{array}
Derivation
  1. Initial program 99.2%

    \[\frac{2 + \left(\left(\sqrt{2} \cdot \left(\sin x - \frac{\sin y}{16}\right)\right) \cdot \left(\sin y - \frac{\sin x}{16}\right)\right) \cdot \left(\cos x - \cos y\right)}{3 \cdot \left(\left(1 + \frac{\sqrt{5} - 1}{2} \cdot \cos x\right) + \frac{3 - \sqrt{5}}{2} \cdot \cos y\right)} \]
  2. Add Preprocessing
  3. Step-by-step derivation
    1. lift-*.f64N/A

      \[\leadsto \frac{2 + \left(\left(\sqrt{2} \cdot \left(\sin x - \frac{\sin y}{16}\right)\right) \cdot \left(\sin y - \frac{\sin x}{16}\right)\right) \cdot \left(\cos x - \cos y\right)}{\color{blue}{3 \cdot \left(\left(1 + \frac{\sqrt{5} - 1}{2} \cdot \cos x\right) + \frac{3 - \sqrt{5}}{2} \cdot \cos y\right)}} \]
    2. lift-+.f64N/A

      \[\leadsto \frac{2 + \left(\left(\sqrt{2} \cdot \left(\sin x - \frac{\sin y}{16}\right)\right) \cdot \left(\sin y - \frac{\sin x}{16}\right)\right) \cdot \left(\cos x - \cos y\right)}{3 \cdot \color{blue}{\left(\left(1 + \frac{\sqrt{5} - 1}{2} \cdot \cos x\right) + \frac{3 - \sqrt{5}}{2} \cdot \cos y\right)}} \]
    3. +-commutativeN/A

      \[\leadsto \frac{2 + \left(\left(\sqrt{2} \cdot \left(\sin x - \frac{\sin y}{16}\right)\right) \cdot \left(\sin y - \frac{\sin x}{16}\right)\right) \cdot \left(\cos x - \cos y\right)}{3 \cdot \color{blue}{\left(\frac{3 - \sqrt{5}}{2} \cdot \cos y + \left(1 + \frac{\sqrt{5} - 1}{2} \cdot \cos x\right)\right)}} \]
    4. distribute-lft-inN/A

      \[\leadsto \frac{2 + \left(\left(\sqrt{2} \cdot \left(\sin x - \frac{\sin y}{16}\right)\right) \cdot \left(\sin y - \frac{\sin x}{16}\right)\right) \cdot \left(\cos x - \cos y\right)}{\color{blue}{3 \cdot \left(\frac{3 - \sqrt{5}}{2} \cdot \cos y\right) + 3 \cdot \left(1 + \frac{\sqrt{5} - 1}{2} \cdot \cos x\right)}} \]
    5. lift-*.f64N/A

      \[\leadsto \frac{2 + \left(\left(\sqrt{2} \cdot \left(\sin x - \frac{\sin y}{16}\right)\right) \cdot \left(\sin y - \frac{\sin x}{16}\right)\right) \cdot \left(\cos x - \cos y\right)}{3 \cdot \color{blue}{\left(\frac{3 - \sqrt{5}}{2} \cdot \cos y\right)} + 3 \cdot \left(1 + \frac{\sqrt{5} - 1}{2} \cdot \cos x\right)} \]
    6. associate-*r*N/A

      \[\leadsto \frac{2 + \left(\left(\sqrt{2} \cdot \left(\sin x - \frac{\sin y}{16}\right)\right) \cdot \left(\sin y - \frac{\sin x}{16}\right)\right) \cdot \left(\cos x - \cos y\right)}{\color{blue}{\left(3 \cdot \frac{3 - \sqrt{5}}{2}\right) \cdot \cos y} + 3 \cdot \left(1 + \frac{\sqrt{5} - 1}{2} \cdot \cos x\right)} \]
    7. *-commutativeN/A

      \[\leadsto \frac{2 + \left(\left(\sqrt{2} \cdot \left(\sin x - \frac{\sin y}{16}\right)\right) \cdot \left(\sin y - \frac{\sin x}{16}\right)\right) \cdot \left(\cos x - \cos y\right)}{\left(3 \cdot \frac{3 - \sqrt{5}}{2}\right) \cdot \cos y + \color{blue}{\left(1 + \frac{\sqrt{5} - 1}{2} \cdot \cos x\right) \cdot 3}} \]
    8. lower-fma.f64N/A

      \[\leadsto \frac{2 + \left(\left(\sqrt{2} \cdot \left(\sin x - \frac{\sin y}{16}\right)\right) \cdot \left(\sin y - \frac{\sin x}{16}\right)\right) \cdot \left(\cos x - \cos y\right)}{\color{blue}{\mathsf{fma}\left(3 \cdot \frac{3 - \sqrt{5}}{2}, \cos y, \left(1 + \frac{\sqrt{5} - 1}{2} \cdot \cos x\right) \cdot 3\right)}} \]
  4. Applied rewrites99.3%

    \[\leadsto \frac{2 + \left(\left(\sqrt{2} \cdot \left(\sin x - \frac{\sin y}{16}\right)\right) \cdot \left(\sin y - \frac{\sin x}{16}\right)\right) \cdot \left(\cos x - \cos y\right)}{\color{blue}{\mathsf{fma}\left(3 \cdot \left(1.5 - \sqrt{5} \cdot 0.5\right), \cos y, \mathsf{fma}\left(3, \mathsf{fma}\left(\sqrt{5}, 0.5, -0.5\right) \cdot \cos x, 3\right)\right)}} \]
  5. Step-by-step derivation
    1. lift-*.f64N/A

      \[\leadsto \frac{2 + \left(\left(\sqrt{2} \cdot \left(\sin x - \frac{\sin y}{16}\right)\right) \cdot \left(\sin y - \frac{\sin x}{16}\right)\right) \cdot \left(\cos x - \cos y\right)}{\mathsf{fma}\left(\color{blue}{3 \cdot \left(\frac{3}{2} - \sqrt{5} \cdot \frac{1}{2}\right)}, \cos y, \mathsf{fma}\left(3, \mathsf{fma}\left(\sqrt{5}, \frac{1}{2}, \frac{-1}{2}\right) \cdot \cos x, 3\right)\right)} \]
    2. lift--.f64N/A

      \[\leadsto \frac{2 + \left(\left(\sqrt{2} \cdot \left(\sin x - \frac{\sin y}{16}\right)\right) \cdot \left(\sin y - \frac{\sin x}{16}\right)\right) \cdot \left(\cos x - \cos y\right)}{\mathsf{fma}\left(3 \cdot \color{blue}{\left(\frac{3}{2} - \sqrt{5} \cdot \frac{1}{2}\right)}, \cos y, \mathsf{fma}\left(3, \mathsf{fma}\left(\sqrt{5}, \frac{1}{2}, \frac{-1}{2}\right) \cdot \cos x, 3\right)\right)} \]
    3. flip--N/A

      \[\leadsto \frac{2 + \left(\left(\sqrt{2} \cdot \left(\sin x - \frac{\sin y}{16}\right)\right) \cdot \left(\sin y - \frac{\sin x}{16}\right)\right) \cdot \left(\cos x - \cos y\right)}{\mathsf{fma}\left(3 \cdot \color{blue}{\frac{\frac{3}{2} \cdot \frac{3}{2} - \left(\sqrt{5} \cdot \frac{1}{2}\right) \cdot \left(\sqrt{5} \cdot \frac{1}{2}\right)}{\frac{3}{2} + \sqrt{5} \cdot \frac{1}{2}}}, \cos y, \mathsf{fma}\left(3, \mathsf{fma}\left(\sqrt{5}, \frac{1}{2}, \frac{-1}{2}\right) \cdot \cos x, 3\right)\right)} \]
    4. associate-*r/N/A

      \[\leadsto \frac{2 + \left(\left(\sqrt{2} \cdot \left(\sin x - \frac{\sin y}{16}\right)\right) \cdot \left(\sin y - \frac{\sin x}{16}\right)\right) \cdot \left(\cos x - \cos y\right)}{\mathsf{fma}\left(\color{blue}{\frac{3 \cdot \left(\frac{3}{2} \cdot \frac{3}{2} - \left(\sqrt{5} \cdot \frac{1}{2}\right) \cdot \left(\sqrt{5} \cdot \frac{1}{2}\right)\right)}{\frac{3}{2} + \sqrt{5} \cdot \frac{1}{2}}}, \cos y, \mathsf{fma}\left(3, \mathsf{fma}\left(\sqrt{5}, \frac{1}{2}, \frac{-1}{2}\right) \cdot \cos x, 3\right)\right)} \]
    5. metadata-evalN/A

      \[\leadsto \frac{2 + \left(\left(\sqrt{2} \cdot \left(\sin x - \frac{\sin y}{16}\right)\right) \cdot \left(\sin y - \frac{\sin x}{16}\right)\right) \cdot \left(\cos x - \cos y\right)}{\mathsf{fma}\left(\frac{3 \cdot \left(\color{blue}{\frac{9}{4}} - \left(\sqrt{5} \cdot \frac{1}{2}\right) \cdot \left(\sqrt{5} \cdot \frac{1}{2}\right)\right)}{\frac{3}{2} + \sqrt{5} \cdot \frac{1}{2}}, \cos y, \mathsf{fma}\left(3, \mathsf{fma}\left(\sqrt{5}, \frac{1}{2}, \frac{-1}{2}\right) \cdot \cos x, 3\right)\right)} \]
    6. lift-*.f64N/A

      \[\leadsto \frac{2 + \left(\left(\sqrt{2} \cdot \left(\sin x - \frac{\sin y}{16}\right)\right) \cdot \left(\sin y - \frac{\sin x}{16}\right)\right) \cdot \left(\cos x - \cos y\right)}{\mathsf{fma}\left(\frac{3 \cdot \left(\frac{9}{4} - \color{blue}{\left(\sqrt{5} \cdot \frac{1}{2}\right)} \cdot \left(\sqrt{5} \cdot \frac{1}{2}\right)\right)}{\frac{3}{2} + \sqrt{5} \cdot \frac{1}{2}}, \cos y, \mathsf{fma}\left(3, \mathsf{fma}\left(\sqrt{5}, \frac{1}{2}, \frac{-1}{2}\right) \cdot \cos x, 3\right)\right)} \]
    7. lift-*.f64N/A

      \[\leadsto \frac{2 + \left(\left(\sqrt{2} \cdot \left(\sin x - \frac{\sin y}{16}\right)\right) \cdot \left(\sin y - \frac{\sin x}{16}\right)\right) \cdot \left(\cos x - \cos y\right)}{\mathsf{fma}\left(\frac{3 \cdot \left(\frac{9}{4} - \left(\sqrt{5} \cdot \frac{1}{2}\right) \cdot \color{blue}{\left(\sqrt{5} \cdot \frac{1}{2}\right)}\right)}{\frac{3}{2} + \sqrt{5} \cdot \frac{1}{2}}, \cos y, \mathsf{fma}\left(3, \mathsf{fma}\left(\sqrt{5}, \frac{1}{2}, \frac{-1}{2}\right) \cdot \cos x, 3\right)\right)} \]
    8. swap-sqrN/A

      \[\leadsto \frac{2 + \left(\left(\sqrt{2} \cdot \left(\sin x - \frac{\sin y}{16}\right)\right) \cdot \left(\sin y - \frac{\sin x}{16}\right)\right) \cdot \left(\cos x - \cos y\right)}{\mathsf{fma}\left(\frac{3 \cdot \left(\frac{9}{4} - \color{blue}{\left(\sqrt{5} \cdot \sqrt{5}\right) \cdot \left(\frac{1}{2} \cdot \frac{1}{2}\right)}\right)}{\frac{3}{2} + \sqrt{5} \cdot \frac{1}{2}}, \cos y, \mathsf{fma}\left(3, \mathsf{fma}\left(\sqrt{5}, \frac{1}{2}, \frac{-1}{2}\right) \cdot \cos x, 3\right)\right)} \]
    9. lift-sqrt.f64N/A

      \[\leadsto \frac{2 + \left(\left(\sqrt{2} \cdot \left(\sin x - \frac{\sin y}{16}\right)\right) \cdot \left(\sin y - \frac{\sin x}{16}\right)\right) \cdot \left(\cos x - \cos y\right)}{\mathsf{fma}\left(\frac{3 \cdot \left(\frac{9}{4} - \left(\color{blue}{\sqrt{5}} \cdot \sqrt{5}\right) \cdot \left(\frac{1}{2} \cdot \frac{1}{2}\right)\right)}{\frac{3}{2} + \sqrt{5} \cdot \frac{1}{2}}, \cos y, \mathsf{fma}\left(3, \mathsf{fma}\left(\sqrt{5}, \frac{1}{2}, \frac{-1}{2}\right) \cdot \cos x, 3\right)\right)} \]
    10. lift-sqrt.f64N/A

      \[\leadsto \frac{2 + \left(\left(\sqrt{2} \cdot \left(\sin x - \frac{\sin y}{16}\right)\right) \cdot \left(\sin y - \frac{\sin x}{16}\right)\right) \cdot \left(\cos x - \cos y\right)}{\mathsf{fma}\left(\frac{3 \cdot \left(\frac{9}{4} - \left(\sqrt{5} \cdot \color{blue}{\sqrt{5}}\right) \cdot \left(\frac{1}{2} \cdot \frac{1}{2}\right)\right)}{\frac{3}{2} + \sqrt{5} \cdot \frac{1}{2}}, \cos y, \mathsf{fma}\left(3, \mathsf{fma}\left(\sqrt{5}, \frac{1}{2}, \frac{-1}{2}\right) \cdot \cos x, 3\right)\right)} \]
    11. rem-square-sqrtN/A

      \[\leadsto \frac{2 + \left(\left(\sqrt{2} \cdot \left(\sin x - \frac{\sin y}{16}\right)\right) \cdot \left(\sin y - \frac{\sin x}{16}\right)\right) \cdot \left(\cos x - \cos y\right)}{\mathsf{fma}\left(\frac{3 \cdot \left(\frac{9}{4} - \color{blue}{5} \cdot \left(\frac{1}{2} \cdot \frac{1}{2}\right)\right)}{\frac{3}{2} + \sqrt{5} \cdot \frac{1}{2}}, \cos y, \mathsf{fma}\left(3, \mathsf{fma}\left(\sqrt{5}, \frac{1}{2}, \frac{-1}{2}\right) \cdot \cos x, 3\right)\right)} \]
    12. metadata-evalN/A

      \[\leadsto \frac{2 + \left(\left(\sqrt{2} \cdot \left(\sin x - \frac{\sin y}{16}\right)\right) \cdot \left(\sin y - \frac{\sin x}{16}\right)\right) \cdot \left(\cos x - \cos y\right)}{\mathsf{fma}\left(\frac{3 \cdot \left(\frac{9}{4} - 5 \cdot \color{blue}{\frac{1}{4}}\right)}{\frac{3}{2} + \sqrt{5} \cdot \frac{1}{2}}, \cos y, \mathsf{fma}\left(3, \mathsf{fma}\left(\sqrt{5}, \frac{1}{2}, \frac{-1}{2}\right) \cdot \cos x, 3\right)\right)} \]
    13. metadata-evalN/A

      \[\leadsto \frac{2 + \left(\left(\sqrt{2} \cdot \left(\sin x - \frac{\sin y}{16}\right)\right) \cdot \left(\sin y - \frac{\sin x}{16}\right)\right) \cdot \left(\cos x - \cos y\right)}{\mathsf{fma}\left(\frac{3 \cdot \left(\frac{9}{4} - \color{blue}{\frac{5}{4}}\right)}{\frac{3}{2} + \sqrt{5} \cdot \frac{1}{2}}, \cos y, \mathsf{fma}\left(3, \mathsf{fma}\left(\sqrt{5}, \frac{1}{2}, \frac{-1}{2}\right) \cdot \cos x, 3\right)\right)} \]
    14. metadata-evalN/A

      \[\leadsto \frac{2 + \left(\left(\sqrt{2} \cdot \left(\sin x - \frac{\sin y}{16}\right)\right) \cdot \left(\sin y - \frac{\sin x}{16}\right)\right) \cdot \left(\cos x - \cos y\right)}{\mathsf{fma}\left(\frac{3 \cdot \color{blue}{1}}{\frac{3}{2} + \sqrt{5} \cdot \frac{1}{2}}, \cos y, \mathsf{fma}\left(3, \mathsf{fma}\left(\sqrt{5}, \frac{1}{2}, \frac{-1}{2}\right) \cdot \cos x, 3\right)\right)} \]
    15. metadata-evalN/A

      \[\leadsto \frac{2 + \left(\left(\sqrt{2} \cdot \left(\sin x - \frac{\sin y}{16}\right)\right) \cdot \left(\sin y - \frac{\sin x}{16}\right)\right) \cdot \left(\cos x - \cos y\right)}{\mathsf{fma}\left(\frac{\color{blue}{3}}{\frac{3}{2} + \sqrt{5} \cdot \frac{1}{2}}, \cos y, \mathsf{fma}\left(3, \mathsf{fma}\left(\sqrt{5}, \frac{1}{2}, \frac{-1}{2}\right) \cdot \cos x, 3\right)\right)} \]
    16. lower-/.f64N/A

      \[\leadsto \frac{2 + \left(\left(\sqrt{2} \cdot \left(\sin x - \frac{\sin y}{16}\right)\right) \cdot \left(\sin y - \frac{\sin x}{16}\right)\right) \cdot \left(\cos x - \cos y\right)}{\mathsf{fma}\left(\color{blue}{\frac{3}{\frac{3}{2} + \sqrt{5} \cdot \frac{1}{2}}}, \cos y, \mathsf{fma}\left(3, \mathsf{fma}\left(\sqrt{5}, \frac{1}{2}, \frac{-1}{2}\right) \cdot \cos x, 3\right)\right)} \]
    17. +-commutativeN/A

      \[\leadsto \frac{2 + \left(\left(\sqrt{2} \cdot \left(\sin x - \frac{\sin y}{16}\right)\right) \cdot \left(\sin y - \frac{\sin x}{16}\right)\right) \cdot \left(\cos x - \cos y\right)}{\mathsf{fma}\left(\frac{3}{\color{blue}{\sqrt{5} \cdot \frac{1}{2} + \frac{3}{2}}}, \cos y, \mathsf{fma}\left(3, \mathsf{fma}\left(\sqrt{5}, \frac{1}{2}, \frac{-1}{2}\right) \cdot \cos x, 3\right)\right)} \]
    18. lift-*.f64N/A

      \[\leadsto \frac{2 + \left(\left(\sqrt{2} \cdot \left(\sin x - \frac{\sin y}{16}\right)\right) \cdot \left(\sin y - \frac{\sin x}{16}\right)\right) \cdot \left(\cos x - \cos y\right)}{\mathsf{fma}\left(\frac{3}{\color{blue}{\sqrt{5} \cdot \frac{1}{2}} + \frac{3}{2}}, \cos y, \mathsf{fma}\left(3, \mathsf{fma}\left(\sqrt{5}, \frac{1}{2}, \frac{-1}{2}\right) \cdot \cos x, 3\right)\right)} \]
    19. lower-fma.f6499.4

      \[\leadsto \frac{2 + \left(\left(\sqrt{2} \cdot \left(\sin x - \frac{\sin y}{16}\right)\right) \cdot \left(\sin y - \frac{\sin x}{16}\right)\right) \cdot \left(\cos x - \cos y\right)}{\mathsf{fma}\left(\frac{3}{\color{blue}{\mathsf{fma}\left(\sqrt{5}, 0.5, 1.5\right)}}, \cos y, \mathsf{fma}\left(3, \mathsf{fma}\left(\sqrt{5}, 0.5, -0.5\right) \cdot \cos x, 3\right)\right)} \]
  6. Applied rewrites99.4%

    \[\leadsto \frac{2 + \left(\left(\sqrt{2} \cdot \left(\sin x - \frac{\sin y}{16}\right)\right) \cdot \left(\sin y - \frac{\sin x}{16}\right)\right) \cdot \left(\cos x - \cos y\right)}{\mathsf{fma}\left(\color{blue}{\frac{3}{\mathsf{fma}\left(\sqrt{5}, 0.5, 1.5\right)}}, \cos y, \mathsf{fma}\left(3, \mathsf{fma}\left(\sqrt{5}, 0.5, -0.5\right) \cdot \cos x, 3\right)\right)} \]
  7. Taylor expanded in x around inf

    \[\leadsto \color{blue}{\frac{2 + \sqrt{2} \cdot \left(\left(\cos x - \cos y\right) \cdot \left(\left(\sin x - \frac{1}{16} \cdot \sin y\right) \cdot \left(\sin y - \frac{1}{16} \cdot \sin x\right)\right)\right)}{3 + \left(3 \cdot \left(\cos x \cdot \left(\frac{1}{2} \cdot \sqrt{5} - \frac{1}{2}\right)\right) + 3 \cdot \frac{\cos y}{\frac{3}{2} + \frac{1}{2} \cdot \sqrt{5}}\right)}} \]
  8. Applied rewrites99.4%

    \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(\sqrt{2}, \left(\cos x - \cos y\right) \cdot \left(\mathsf{fma}\left(-0.0625, \sin y, \sin x\right) \cdot \mathsf{fma}\left(-0.0625, \sin x, \sin y\right)\right), 2\right)}{\mathsf{fma}\left(3, \mathsf{fma}\left(\mathsf{fma}\left(0.5, \sqrt{5}, -0.5\right), \cos x, \frac{\cos y}{\mathsf{fma}\left(0.5, \sqrt{5}, 1.5\right)}\right), 3\right)}} \]
  9. Step-by-step derivation
    1. Applied rewrites99.4%

      \[\leadsto \frac{\mathsf{fma}\left(\left(\cos x - \cos y\right) \cdot \mathsf{fma}\left(-0.0625, \sin y, \sin x\right), \mathsf{fma}\left(-0.0625, \sin x, \sin y\right) \cdot \sqrt{2}, 2\right)}{\mathsf{fma}\left(\color{blue}{3}, \mathsf{fma}\left(\mathsf{fma}\left(0.5, \sqrt{5}, -0.5\right), \cos x, \frac{\cos y}{\mathsf{fma}\left(0.5, \sqrt{5}, 1.5\right)}\right), 3\right)} \]
    2. Add Preprocessing

    Alternative 2: 99.4% accurate, 1.0× speedup?

    \[\begin{array}{l} \\ \frac{\mathsf{fma}\left(\sqrt{2}, \left(\cos x - \cos y\right) \cdot \left(\mathsf{fma}\left(-0.0625, \sin y, \sin x\right) \cdot \mathsf{fma}\left(-0.0625, \sin x, \sin y\right)\right), 2\right)}{\mathsf{fma}\left(3, \mathsf{fma}\left(\mathsf{fma}\left(0.5, \sqrt{5}, -0.5\right), \cos x, \frac{\cos y}{\mathsf{fma}\left(0.5, \sqrt{5}, 1.5\right)}\right), 3\right)} \end{array} \]
    (FPCore (x y)
     :precision binary64
     (/
      (fma
       (sqrt 2.0)
       (*
        (- (cos x) (cos y))
        (* (fma -0.0625 (sin y) (sin x)) (fma -0.0625 (sin x) (sin y))))
       2.0)
      (fma
       3.0
       (fma (fma 0.5 (sqrt 5.0) -0.5) (cos x) (/ (cos y) (fma 0.5 (sqrt 5.0) 1.5)))
       3.0)))
    double code(double x, double y) {
    	return fma(sqrt(2.0), ((cos(x) - cos(y)) * (fma(-0.0625, sin(y), sin(x)) * fma(-0.0625, sin(x), sin(y)))), 2.0) / fma(3.0, fma(fma(0.5, sqrt(5.0), -0.5), cos(x), (cos(y) / fma(0.5, sqrt(5.0), 1.5))), 3.0);
    }
    
    function code(x, y)
    	return Float64(fma(sqrt(2.0), Float64(Float64(cos(x) - cos(y)) * Float64(fma(-0.0625, sin(y), sin(x)) * fma(-0.0625, sin(x), sin(y)))), 2.0) / fma(3.0, fma(fma(0.5, sqrt(5.0), -0.5), cos(x), Float64(cos(y) / fma(0.5, sqrt(5.0), 1.5))), 3.0))
    end
    
    code[x_, y_] := N[(N[(N[Sqrt[2.0], $MachinePrecision] * N[(N[(N[Cos[x], $MachinePrecision] - N[Cos[y], $MachinePrecision]), $MachinePrecision] * N[(N[(-0.0625 * N[Sin[y], $MachinePrecision] + N[Sin[x], $MachinePrecision]), $MachinePrecision] * N[(-0.0625 * N[Sin[x], $MachinePrecision] + N[Sin[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 2.0), $MachinePrecision] / N[(3.0 * N[(N[(0.5 * N[Sqrt[5.0], $MachinePrecision] + -0.5), $MachinePrecision] * N[Cos[x], $MachinePrecision] + N[(N[Cos[y], $MachinePrecision] / N[(0.5 * N[Sqrt[5.0], $MachinePrecision] + 1.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 3.0), $MachinePrecision]), $MachinePrecision]
    
    \begin{array}{l}
    
    \\
    \frac{\mathsf{fma}\left(\sqrt{2}, \left(\cos x - \cos y\right) \cdot \left(\mathsf{fma}\left(-0.0625, \sin y, \sin x\right) \cdot \mathsf{fma}\left(-0.0625, \sin x, \sin y\right)\right), 2\right)}{\mathsf{fma}\left(3, \mathsf{fma}\left(\mathsf{fma}\left(0.5, \sqrt{5}, -0.5\right), \cos x, \frac{\cos y}{\mathsf{fma}\left(0.5, \sqrt{5}, 1.5\right)}\right), 3\right)}
    \end{array}
    
    Derivation
    1. Initial program 99.3%

      \[\frac{2 + \left(\left(\sqrt{2} \cdot \left(\sin x - \frac{\sin y}{16}\right)\right) \cdot \left(\sin y - \frac{\sin x}{16}\right)\right) \cdot \left(\cos x - \cos y\right)}{3 \cdot \left(\left(1 + \frac{\sqrt{5} - 1}{2} \cdot \cos x\right) + \frac{3 - \sqrt{5}}{2} \cdot \cos y\right)} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \frac{2 + \left(\left(\sqrt{2} \cdot \left(\sin x - \frac{\sin y}{16}\right)\right) \cdot \left(\sin y - \frac{\sin x}{16}\right)\right) \cdot \left(\cos x - \cos y\right)}{\color{blue}{3 \cdot \left(\left(1 + \frac{\sqrt{5} - 1}{2} \cdot \cos x\right) + \frac{3 - \sqrt{5}}{2} \cdot \cos y\right)}} \]
      2. lift-+.f64N/A

        \[\leadsto \frac{2 + \left(\left(\sqrt{2} \cdot \left(\sin x - \frac{\sin y}{16}\right)\right) \cdot \left(\sin y - \frac{\sin x}{16}\right)\right) \cdot \left(\cos x - \cos y\right)}{3 \cdot \color{blue}{\left(\left(1 + \frac{\sqrt{5} - 1}{2} \cdot \cos x\right) + \frac{3 - \sqrt{5}}{2} \cdot \cos y\right)}} \]
      3. +-commutativeN/A

        \[\leadsto \frac{2 + \left(\left(\sqrt{2} \cdot \left(\sin x - \frac{\sin y}{16}\right)\right) \cdot \left(\sin y - \frac{\sin x}{16}\right)\right) \cdot \left(\cos x - \cos y\right)}{3 \cdot \color{blue}{\left(\frac{3 - \sqrt{5}}{2} \cdot \cos y + \left(1 + \frac{\sqrt{5} - 1}{2} \cdot \cos x\right)\right)}} \]
      4. distribute-lft-inN/A

        \[\leadsto \frac{2 + \left(\left(\sqrt{2} \cdot \left(\sin x - \frac{\sin y}{16}\right)\right) \cdot \left(\sin y - \frac{\sin x}{16}\right)\right) \cdot \left(\cos x - \cos y\right)}{\color{blue}{3 \cdot \left(\frac{3 - \sqrt{5}}{2} \cdot \cos y\right) + 3 \cdot \left(1 + \frac{\sqrt{5} - 1}{2} \cdot \cos x\right)}} \]
      5. lift-*.f64N/A

        \[\leadsto \frac{2 + \left(\left(\sqrt{2} \cdot \left(\sin x - \frac{\sin y}{16}\right)\right) \cdot \left(\sin y - \frac{\sin x}{16}\right)\right) \cdot \left(\cos x - \cos y\right)}{3 \cdot \color{blue}{\left(\frac{3 - \sqrt{5}}{2} \cdot \cos y\right)} + 3 \cdot \left(1 + \frac{\sqrt{5} - 1}{2} \cdot \cos x\right)} \]
      6. associate-*r*N/A

        \[\leadsto \frac{2 + \left(\left(\sqrt{2} \cdot \left(\sin x - \frac{\sin y}{16}\right)\right) \cdot \left(\sin y - \frac{\sin x}{16}\right)\right) \cdot \left(\cos x - \cos y\right)}{\color{blue}{\left(3 \cdot \frac{3 - \sqrt{5}}{2}\right) \cdot \cos y} + 3 \cdot \left(1 + \frac{\sqrt{5} - 1}{2} \cdot \cos x\right)} \]
      7. *-commutativeN/A

        \[\leadsto \frac{2 + \left(\left(\sqrt{2} \cdot \left(\sin x - \frac{\sin y}{16}\right)\right) \cdot \left(\sin y - \frac{\sin x}{16}\right)\right) \cdot \left(\cos x - \cos y\right)}{\left(3 \cdot \frac{3 - \sqrt{5}}{2}\right) \cdot \cos y + \color{blue}{\left(1 + \frac{\sqrt{5} - 1}{2} \cdot \cos x\right) \cdot 3}} \]
      8. lower-fma.f64N/A

        \[\leadsto \frac{2 + \left(\left(\sqrt{2} \cdot \left(\sin x - \frac{\sin y}{16}\right)\right) \cdot \left(\sin y - \frac{\sin x}{16}\right)\right) \cdot \left(\cos x - \cos y\right)}{\color{blue}{\mathsf{fma}\left(3 \cdot \frac{3 - \sqrt{5}}{2}, \cos y, \left(1 + \frac{\sqrt{5} - 1}{2} \cdot \cos x\right) \cdot 3\right)}} \]
    4. Applied rewrites99.3%

      \[\leadsto \frac{2 + \left(\left(\sqrt{2} \cdot \left(\sin x - \frac{\sin y}{16}\right)\right) \cdot \left(\sin y - \frac{\sin x}{16}\right)\right) \cdot \left(\cos x - \cos y\right)}{\color{blue}{\mathsf{fma}\left(3 \cdot \left(1.5 - \sqrt{5} \cdot 0.5\right), \cos y, \mathsf{fma}\left(3, \mathsf{fma}\left(\sqrt{5}, 0.5, -0.5\right) \cdot \cos x, 3\right)\right)}} \]
    5. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \frac{2 + \left(\left(\sqrt{2} \cdot \left(\sin x - \frac{\sin y}{16}\right)\right) \cdot \left(\sin y - \frac{\sin x}{16}\right)\right) \cdot \left(\cos x - \cos y\right)}{\mathsf{fma}\left(\color{blue}{3 \cdot \left(\frac{3}{2} - \sqrt{5} \cdot \frac{1}{2}\right)}, \cos y, \mathsf{fma}\left(3, \mathsf{fma}\left(\sqrt{5}, \frac{1}{2}, \frac{-1}{2}\right) \cdot \cos x, 3\right)\right)} \]
      2. lift--.f64N/A

        \[\leadsto \frac{2 + \left(\left(\sqrt{2} \cdot \left(\sin x - \frac{\sin y}{16}\right)\right) \cdot \left(\sin y - \frac{\sin x}{16}\right)\right) \cdot \left(\cos x - \cos y\right)}{\mathsf{fma}\left(3 \cdot \color{blue}{\left(\frac{3}{2} - \sqrt{5} \cdot \frac{1}{2}\right)}, \cos y, \mathsf{fma}\left(3, \mathsf{fma}\left(\sqrt{5}, \frac{1}{2}, \frac{-1}{2}\right) \cdot \cos x, 3\right)\right)} \]
      3. flip--N/A

        \[\leadsto \frac{2 + \left(\left(\sqrt{2} \cdot \left(\sin x - \frac{\sin y}{16}\right)\right) \cdot \left(\sin y - \frac{\sin x}{16}\right)\right) \cdot \left(\cos x - \cos y\right)}{\mathsf{fma}\left(3 \cdot \color{blue}{\frac{\frac{3}{2} \cdot \frac{3}{2} - \left(\sqrt{5} \cdot \frac{1}{2}\right) \cdot \left(\sqrt{5} \cdot \frac{1}{2}\right)}{\frac{3}{2} + \sqrt{5} \cdot \frac{1}{2}}}, \cos y, \mathsf{fma}\left(3, \mathsf{fma}\left(\sqrt{5}, \frac{1}{2}, \frac{-1}{2}\right) \cdot \cos x, 3\right)\right)} \]
      4. associate-*r/N/A

        \[\leadsto \frac{2 + \left(\left(\sqrt{2} \cdot \left(\sin x - \frac{\sin y}{16}\right)\right) \cdot \left(\sin y - \frac{\sin x}{16}\right)\right) \cdot \left(\cos x - \cos y\right)}{\mathsf{fma}\left(\color{blue}{\frac{3 \cdot \left(\frac{3}{2} \cdot \frac{3}{2} - \left(\sqrt{5} \cdot \frac{1}{2}\right) \cdot \left(\sqrt{5} \cdot \frac{1}{2}\right)\right)}{\frac{3}{2} + \sqrt{5} \cdot \frac{1}{2}}}, \cos y, \mathsf{fma}\left(3, \mathsf{fma}\left(\sqrt{5}, \frac{1}{2}, \frac{-1}{2}\right) \cdot \cos x, 3\right)\right)} \]
      5. metadata-evalN/A

        \[\leadsto \frac{2 + \left(\left(\sqrt{2} \cdot \left(\sin x - \frac{\sin y}{16}\right)\right) \cdot \left(\sin y - \frac{\sin x}{16}\right)\right) \cdot \left(\cos x - \cos y\right)}{\mathsf{fma}\left(\frac{3 \cdot \left(\color{blue}{\frac{9}{4}} - \left(\sqrt{5} \cdot \frac{1}{2}\right) \cdot \left(\sqrt{5} \cdot \frac{1}{2}\right)\right)}{\frac{3}{2} + \sqrt{5} \cdot \frac{1}{2}}, \cos y, \mathsf{fma}\left(3, \mathsf{fma}\left(\sqrt{5}, \frac{1}{2}, \frac{-1}{2}\right) \cdot \cos x, 3\right)\right)} \]
      6. lift-*.f64N/A

        \[\leadsto \frac{2 + \left(\left(\sqrt{2} \cdot \left(\sin x - \frac{\sin y}{16}\right)\right) \cdot \left(\sin y - \frac{\sin x}{16}\right)\right) \cdot \left(\cos x - \cos y\right)}{\mathsf{fma}\left(\frac{3 \cdot \left(\frac{9}{4} - \color{blue}{\left(\sqrt{5} \cdot \frac{1}{2}\right)} \cdot \left(\sqrt{5} \cdot \frac{1}{2}\right)\right)}{\frac{3}{2} + \sqrt{5} \cdot \frac{1}{2}}, \cos y, \mathsf{fma}\left(3, \mathsf{fma}\left(\sqrt{5}, \frac{1}{2}, \frac{-1}{2}\right) \cdot \cos x, 3\right)\right)} \]
      7. lift-*.f64N/A

        \[\leadsto \frac{2 + \left(\left(\sqrt{2} \cdot \left(\sin x - \frac{\sin y}{16}\right)\right) \cdot \left(\sin y - \frac{\sin x}{16}\right)\right) \cdot \left(\cos x - \cos y\right)}{\mathsf{fma}\left(\frac{3 \cdot \left(\frac{9}{4} - \left(\sqrt{5} \cdot \frac{1}{2}\right) \cdot \color{blue}{\left(\sqrt{5} \cdot \frac{1}{2}\right)}\right)}{\frac{3}{2} + \sqrt{5} \cdot \frac{1}{2}}, \cos y, \mathsf{fma}\left(3, \mathsf{fma}\left(\sqrt{5}, \frac{1}{2}, \frac{-1}{2}\right) \cdot \cos x, 3\right)\right)} \]
      8. swap-sqrN/A

        \[\leadsto \frac{2 + \left(\left(\sqrt{2} \cdot \left(\sin x - \frac{\sin y}{16}\right)\right) \cdot \left(\sin y - \frac{\sin x}{16}\right)\right) \cdot \left(\cos x - \cos y\right)}{\mathsf{fma}\left(\frac{3 \cdot \left(\frac{9}{4} - \color{blue}{\left(\sqrt{5} \cdot \sqrt{5}\right) \cdot \left(\frac{1}{2} \cdot \frac{1}{2}\right)}\right)}{\frac{3}{2} + \sqrt{5} \cdot \frac{1}{2}}, \cos y, \mathsf{fma}\left(3, \mathsf{fma}\left(\sqrt{5}, \frac{1}{2}, \frac{-1}{2}\right) \cdot \cos x, 3\right)\right)} \]
      9. lift-sqrt.f64N/A

        \[\leadsto \frac{2 + \left(\left(\sqrt{2} \cdot \left(\sin x - \frac{\sin y}{16}\right)\right) \cdot \left(\sin y - \frac{\sin x}{16}\right)\right) \cdot \left(\cos x - \cos y\right)}{\mathsf{fma}\left(\frac{3 \cdot \left(\frac{9}{4} - \left(\color{blue}{\sqrt{5}} \cdot \sqrt{5}\right) \cdot \left(\frac{1}{2} \cdot \frac{1}{2}\right)\right)}{\frac{3}{2} + \sqrt{5} \cdot \frac{1}{2}}, \cos y, \mathsf{fma}\left(3, \mathsf{fma}\left(\sqrt{5}, \frac{1}{2}, \frac{-1}{2}\right) \cdot \cos x, 3\right)\right)} \]
      10. lift-sqrt.f64N/A

        \[\leadsto \frac{2 + \left(\left(\sqrt{2} \cdot \left(\sin x - \frac{\sin y}{16}\right)\right) \cdot \left(\sin y - \frac{\sin x}{16}\right)\right) \cdot \left(\cos x - \cos y\right)}{\mathsf{fma}\left(\frac{3 \cdot \left(\frac{9}{4} - \left(\sqrt{5} \cdot \color{blue}{\sqrt{5}}\right) \cdot \left(\frac{1}{2} \cdot \frac{1}{2}\right)\right)}{\frac{3}{2} + \sqrt{5} \cdot \frac{1}{2}}, \cos y, \mathsf{fma}\left(3, \mathsf{fma}\left(\sqrt{5}, \frac{1}{2}, \frac{-1}{2}\right) \cdot \cos x, 3\right)\right)} \]
      11. rem-square-sqrtN/A

        \[\leadsto \frac{2 + \left(\left(\sqrt{2} \cdot \left(\sin x - \frac{\sin y}{16}\right)\right) \cdot \left(\sin y - \frac{\sin x}{16}\right)\right) \cdot \left(\cos x - \cos y\right)}{\mathsf{fma}\left(\frac{3 \cdot \left(\frac{9}{4} - \color{blue}{5} \cdot \left(\frac{1}{2} \cdot \frac{1}{2}\right)\right)}{\frac{3}{2} + \sqrt{5} \cdot \frac{1}{2}}, \cos y, \mathsf{fma}\left(3, \mathsf{fma}\left(\sqrt{5}, \frac{1}{2}, \frac{-1}{2}\right) \cdot \cos x, 3\right)\right)} \]
      12. metadata-evalN/A

        \[\leadsto \frac{2 + \left(\left(\sqrt{2} \cdot \left(\sin x - \frac{\sin y}{16}\right)\right) \cdot \left(\sin y - \frac{\sin x}{16}\right)\right) \cdot \left(\cos x - \cos y\right)}{\mathsf{fma}\left(\frac{3 \cdot \left(\frac{9}{4} - 5 \cdot \color{blue}{\frac{1}{4}}\right)}{\frac{3}{2} + \sqrt{5} \cdot \frac{1}{2}}, \cos y, \mathsf{fma}\left(3, \mathsf{fma}\left(\sqrt{5}, \frac{1}{2}, \frac{-1}{2}\right) \cdot \cos x, 3\right)\right)} \]
      13. metadata-evalN/A

        \[\leadsto \frac{2 + \left(\left(\sqrt{2} \cdot \left(\sin x - \frac{\sin y}{16}\right)\right) \cdot \left(\sin y - \frac{\sin x}{16}\right)\right) \cdot \left(\cos x - \cos y\right)}{\mathsf{fma}\left(\frac{3 \cdot \left(\frac{9}{4} - \color{blue}{\frac{5}{4}}\right)}{\frac{3}{2} + \sqrt{5} \cdot \frac{1}{2}}, \cos y, \mathsf{fma}\left(3, \mathsf{fma}\left(\sqrt{5}, \frac{1}{2}, \frac{-1}{2}\right) \cdot \cos x, 3\right)\right)} \]
      14. metadata-evalN/A

        \[\leadsto \frac{2 + \left(\left(\sqrt{2} \cdot \left(\sin x - \frac{\sin y}{16}\right)\right) \cdot \left(\sin y - \frac{\sin x}{16}\right)\right) \cdot \left(\cos x - \cos y\right)}{\mathsf{fma}\left(\frac{3 \cdot \color{blue}{1}}{\frac{3}{2} + \sqrt{5} \cdot \frac{1}{2}}, \cos y, \mathsf{fma}\left(3, \mathsf{fma}\left(\sqrt{5}, \frac{1}{2}, \frac{-1}{2}\right) \cdot \cos x, 3\right)\right)} \]
      15. metadata-evalN/A

        \[\leadsto \frac{2 + \left(\left(\sqrt{2} \cdot \left(\sin x - \frac{\sin y}{16}\right)\right) \cdot \left(\sin y - \frac{\sin x}{16}\right)\right) \cdot \left(\cos x - \cos y\right)}{\mathsf{fma}\left(\frac{\color{blue}{3}}{\frac{3}{2} + \sqrt{5} \cdot \frac{1}{2}}, \cos y, \mathsf{fma}\left(3, \mathsf{fma}\left(\sqrt{5}, \frac{1}{2}, \frac{-1}{2}\right) \cdot \cos x, 3\right)\right)} \]
      16. lower-/.f64N/A

        \[\leadsto \frac{2 + \left(\left(\sqrt{2} \cdot \left(\sin x - \frac{\sin y}{16}\right)\right) \cdot \left(\sin y - \frac{\sin x}{16}\right)\right) \cdot \left(\cos x - \cos y\right)}{\mathsf{fma}\left(\color{blue}{\frac{3}{\frac{3}{2} + \sqrt{5} \cdot \frac{1}{2}}}, \cos y, \mathsf{fma}\left(3, \mathsf{fma}\left(\sqrt{5}, \frac{1}{2}, \frac{-1}{2}\right) \cdot \cos x, 3\right)\right)} \]
      17. +-commutativeN/A

        \[\leadsto \frac{2 + \left(\left(\sqrt{2} \cdot \left(\sin x - \frac{\sin y}{16}\right)\right) \cdot \left(\sin y - \frac{\sin x}{16}\right)\right) \cdot \left(\cos x - \cos y\right)}{\mathsf{fma}\left(\frac{3}{\color{blue}{\sqrt{5} \cdot \frac{1}{2} + \frac{3}{2}}}, \cos y, \mathsf{fma}\left(3, \mathsf{fma}\left(\sqrt{5}, \frac{1}{2}, \frac{-1}{2}\right) \cdot \cos x, 3\right)\right)} \]
      18. lift-*.f64N/A

        \[\leadsto \frac{2 + \left(\left(\sqrt{2} \cdot \left(\sin x - \frac{\sin y}{16}\right)\right) \cdot \left(\sin y - \frac{\sin x}{16}\right)\right) \cdot \left(\cos x - \cos y\right)}{\mathsf{fma}\left(\frac{3}{\color{blue}{\sqrt{5} \cdot \frac{1}{2}} + \frac{3}{2}}, \cos y, \mathsf{fma}\left(3, \mathsf{fma}\left(\sqrt{5}, \frac{1}{2}, \frac{-1}{2}\right) \cdot \cos x, 3\right)\right)} \]
      19. lower-fma.f6499.4

        \[\leadsto \frac{2 + \left(\left(\sqrt{2} \cdot \left(\sin x - \frac{\sin y}{16}\right)\right) \cdot \left(\sin y - \frac{\sin x}{16}\right)\right) \cdot \left(\cos x - \cos y\right)}{\mathsf{fma}\left(\frac{3}{\color{blue}{\mathsf{fma}\left(\sqrt{5}, 0.5, 1.5\right)}}, \cos y, \mathsf{fma}\left(3, \mathsf{fma}\left(\sqrt{5}, 0.5, -0.5\right) \cdot \cos x, 3\right)\right)} \]
    6. Applied rewrites99.4%

      \[\leadsto \frac{2 + \left(\left(\sqrt{2} \cdot \left(\sin x - \frac{\sin y}{16}\right)\right) \cdot \left(\sin y - \frac{\sin x}{16}\right)\right) \cdot \left(\cos x - \cos y\right)}{\mathsf{fma}\left(\color{blue}{\frac{3}{\mathsf{fma}\left(\sqrt{5}, 0.5, 1.5\right)}}, \cos y, \mathsf{fma}\left(3, \mathsf{fma}\left(\sqrt{5}, 0.5, -0.5\right) \cdot \cos x, 3\right)\right)} \]
    7. Taylor expanded in x around inf

      \[\leadsto \color{blue}{\frac{2 + \sqrt{2} \cdot \left(\left(\cos x - \cos y\right) \cdot \left(\left(\sin x - \frac{1}{16} \cdot \sin y\right) \cdot \left(\sin y - \frac{1}{16} \cdot \sin x\right)\right)\right)}{3 + \left(3 \cdot \left(\cos x \cdot \left(\frac{1}{2} \cdot \sqrt{5} - \frac{1}{2}\right)\right) + 3 \cdot \frac{\cos y}{\frac{3}{2} + \frac{1}{2} \cdot \sqrt{5}}\right)}} \]
    8. Applied rewrites99.4%

      \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(\sqrt{2}, \left(\cos x - \cos y\right) \cdot \left(\mathsf{fma}\left(-0.0625, \sin y, \sin x\right) \cdot \mathsf{fma}\left(-0.0625, \sin x, \sin y\right)\right), 2\right)}{\mathsf{fma}\left(3, \mathsf{fma}\left(\mathsf{fma}\left(0.5, \sqrt{5}, -0.5\right), \cos x, \frac{\cos y}{\mathsf{fma}\left(0.5, \sqrt{5}, 1.5\right)}\right), 3\right)}} \]
    9. Add Preprocessing

    Reproduce

    ?
    herbie shell --seed 2024228 
    (FPCore (x y)
      :name "Diagrams.TwoD.Path.Metafont.Internal:hobbyF from diagrams-contrib-1.3.0.5"
      :precision binary64
      (/ (+ 2.0 (* (* (* (sqrt 2.0) (- (sin x) (/ (sin y) 16.0))) (- (sin y) (/ (sin x) 16.0))) (- (cos x) (cos y)))) (* 3.0 (+ (+ 1.0 (* (/ (- (sqrt 5.0) 1.0) 2.0) (cos x))) (* (/ (- 3.0 (sqrt 5.0)) 2.0) (cos y))))))