Average Error: 0.5 → 0.5
Time: 9.3s
Precision: 64
\[\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)}\]
\[\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 \frac{\frac{\mathsf{fma}\left({\left(\cos y\right)}^{3}, {\left(\cos x\right)}^{3} + {\left(\cos y\right)}^{3}, {\left(\cos x\right)}^{6}\right) \cdot \left({\left(\cos x\right)}^{3} - {\left(\cos y\right)}^{3}\right)}{\mathsf{fma}\left({\left(\cos y\right)}^{3}, {\left(\cos x\right)}^{3} + {\left(\cos y\right)}^{3}, {\left(\cos x\right)}^{3} \cdot {\left(\cos x\right)}^{3}\right)}}{\mathsf{fma}\left(\cos y, \cos x + \cos y, \cos x \cdot \cos x\right)}}{3 \cdot \left(\left(1 + \frac{\sqrt{5} - 1}{2} \cdot \cos x\right) + \frac{3 - \sqrt{5}}{2} \cdot \cos y\right)}\]
\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)}
\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 \frac{\frac{\mathsf{fma}\left({\left(\cos y\right)}^{3}, {\left(\cos x\right)}^{3} + {\left(\cos y\right)}^{3}, {\left(\cos x\right)}^{6}\right) \cdot \left({\left(\cos x\right)}^{3} - {\left(\cos y\right)}^{3}\right)}{\mathsf{fma}\left({\left(\cos y\right)}^{3}, {\left(\cos x\right)}^{3} + {\left(\cos y\right)}^{3}, {\left(\cos x\right)}^{3} \cdot {\left(\cos x\right)}^{3}\right)}}{\mathsf{fma}\left(\cos y, \cos x + \cos y, \cos x \cdot \cos x\right)}}{3 \cdot \left(\left(1 + \frac{\sqrt{5} - 1}{2} \cdot \cos x\right) + \frac{3 - \sqrt{5}}{2} \cdot \cos y\right)}
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)))));
}
double code(double x, double y) {
	return ((2.0 + (((sqrt(2.0) * (sin(x) - (sin(y) / 16.0))) * (sin(y) - (sin(x) / 16.0))) * (((fma(pow(cos(y), 3.0), (pow(cos(x), 3.0) + pow(cos(y), 3.0)), pow(cos(x), 6.0)) * (pow(cos(x), 3.0) - pow(cos(y), 3.0))) / fma(pow(cos(y), 3.0), (pow(cos(x), 3.0) + pow(cos(y), 3.0)), (pow(cos(x), 3.0) * pow(cos(x), 3.0)))) / fma(cos(y), (cos(x) + cos(y)), (cos(x) * cos(x)))))) / (3.0 * ((1.0 + (((sqrt(5.0) - 1.0) / 2.0) * cos(x))) + (((3.0 - sqrt(5.0)) / 2.0) * cos(y)))));
}

Error

Bits error versus x

Bits error versus y

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 0.5

    \[\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. Using strategy rm
  3. Applied flip3--0.5

    \[\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 \color{blue}{\frac{{\left(\cos x\right)}^{3} - {\left(\cos y\right)}^{3}}{\cos x \cdot \cos x + \left(\cos y \cdot \cos y + \cos x \cdot \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)}\]
  4. Simplified0.5

    \[\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 \frac{{\left(\cos x\right)}^{3} - {\left(\cos y\right)}^{3}}{\color{blue}{\mathsf{fma}\left(\cos y, \cos x + \cos y, \cos x \cdot \cos x\right)}}}{3 \cdot \left(\left(1 + \frac{\sqrt{5} - 1}{2} \cdot \cos x\right) + \frac{3 - \sqrt{5}}{2} \cdot \cos y\right)}\]
  5. Using strategy rm
  6. Applied flip3--0.5

    \[\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 \frac{\color{blue}{\frac{{\left({\left(\cos x\right)}^{3}\right)}^{3} - {\left({\left(\cos y\right)}^{3}\right)}^{3}}{{\left(\cos x\right)}^{3} \cdot {\left(\cos x\right)}^{3} + \left({\left(\cos y\right)}^{3} \cdot {\left(\cos y\right)}^{3} + {\left(\cos x\right)}^{3} \cdot {\left(\cos y\right)}^{3}\right)}}}{\mathsf{fma}\left(\cos y, \cos x + \cos y, \cos x \cdot \cos x\right)}}{3 \cdot \left(\left(1 + \frac{\sqrt{5} - 1}{2} \cdot \cos x\right) + \frac{3 - \sqrt{5}}{2} \cdot \cos y\right)}\]
  7. Simplified0.5

    \[\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 \frac{\frac{{\left({\left(\cos x\right)}^{3}\right)}^{3} - {\left({\left(\cos y\right)}^{3}\right)}^{3}}{\color{blue}{\mathsf{fma}\left({\left(\cos y\right)}^{3}, {\left(\cos x\right)}^{3} + {\left(\cos y\right)}^{3}, {\left(\cos x\right)}^{6}\right)}}}{\mathsf{fma}\left(\cos y, \cos x + \cos y, \cos x \cdot \cos x\right)}}{3 \cdot \left(\left(1 + \frac{\sqrt{5} - 1}{2} \cdot \cos x\right) + \frac{3 - \sqrt{5}}{2} \cdot \cos y\right)}\]
  8. Using strategy rm
  9. Applied difference-cubes0.5

    \[\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 \frac{\frac{\color{blue}{\left({\left(\cos x\right)}^{3} \cdot {\left(\cos x\right)}^{3} + \left({\left(\cos y\right)}^{3} \cdot {\left(\cos y\right)}^{3} + {\left(\cos x\right)}^{3} \cdot {\left(\cos y\right)}^{3}\right)\right) \cdot \left({\left(\cos x\right)}^{3} - {\left(\cos y\right)}^{3}\right)}}{\mathsf{fma}\left({\left(\cos y\right)}^{3}, {\left(\cos x\right)}^{3} + {\left(\cos y\right)}^{3}, {\left(\cos x\right)}^{6}\right)}}{\mathsf{fma}\left(\cos y, \cos x + \cos y, \cos x \cdot \cos x\right)}}{3 \cdot \left(\left(1 + \frac{\sqrt{5} - 1}{2} \cdot \cos x\right) + \frac{3 - \sqrt{5}}{2} \cdot \cos y\right)}\]
  10. Simplified0.5

    \[\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 \frac{\frac{\color{blue}{\mathsf{fma}\left({\left(\cos y\right)}^{3}, {\left(\cos x\right)}^{3} + {\left(\cos y\right)}^{3}, {\left(\cos x\right)}^{6}\right)} \cdot \left({\left(\cos x\right)}^{3} - {\left(\cos y\right)}^{3}\right)}{\mathsf{fma}\left({\left(\cos y\right)}^{3}, {\left(\cos x\right)}^{3} + {\left(\cos y\right)}^{3}, {\left(\cos x\right)}^{6}\right)}}{\mathsf{fma}\left(\cos y, \cos x + \cos y, \cos x \cdot \cos x\right)}}{3 \cdot \left(\left(1 + \frac{\sqrt{5} - 1}{2} \cdot \cos x\right) + \frac{3 - \sqrt{5}}{2} \cdot \cos y\right)}\]
  11. Using strategy rm
  12. Applied sqr-pow0.5

    \[\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 \frac{\frac{\mathsf{fma}\left({\left(\cos y\right)}^{3}, {\left(\cos x\right)}^{3} + {\left(\cos y\right)}^{3}, {\left(\cos x\right)}^{6}\right) \cdot \left({\left(\cos x\right)}^{3} - {\left(\cos y\right)}^{3}\right)}{\mathsf{fma}\left({\left(\cos y\right)}^{3}, {\left(\cos x\right)}^{3} + {\left(\cos y\right)}^{3}, \color{blue}{{\left(\cos x\right)}^{\left(\frac{6}{2}\right)} \cdot {\left(\cos x\right)}^{\left(\frac{6}{2}\right)}}\right)}}{\mathsf{fma}\left(\cos y, \cos x + \cos y, \cos x \cdot \cos x\right)}}{3 \cdot \left(\left(1 + \frac{\sqrt{5} - 1}{2} \cdot \cos x\right) + \frac{3 - \sqrt{5}}{2} \cdot \cos y\right)}\]
  13. Simplified0.5

    \[\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 \frac{\frac{\mathsf{fma}\left({\left(\cos y\right)}^{3}, {\left(\cos x\right)}^{3} + {\left(\cos y\right)}^{3}, {\left(\cos x\right)}^{6}\right) \cdot \left({\left(\cos x\right)}^{3} - {\left(\cos y\right)}^{3}\right)}{\mathsf{fma}\left({\left(\cos y\right)}^{3}, {\left(\cos x\right)}^{3} + {\left(\cos y\right)}^{3}, \color{blue}{{\left(\cos x\right)}^{3}} \cdot {\left(\cos x\right)}^{\left(\frac{6}{2}\right)}\right)}}{\mathsf{fma}\left(\cos y, \cos x + \cos y, \cos x \cdot \cos x\right)}}{3 \cdot \left(\left(1 + \frac{\sqrt{5} - 1}{2} \cdot \cos x\right) + \frac{3 - \sqrt{5}}{2} \cdot \cos y\right)}\]
  14. Simplified0.5

    \[\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 \frac{\frac{\mathsf{fma}\left({\left(\cos y\right)}^{3}, {\left(\cos x\right)}^{3} + {\left(\cos y\right)}^{3}, {\left(\cos x\right)}^{6}\right) \cdot \left({\left(\cos x\right)}^{3} - {\left(\cos y\right)}^{3}\right)}{\mathsf{fma}\left({\left(\cos y\right)}^{3}, {\left(\cos x\right)}^{3} + {\left(\cos y\right)}^{3}, {\left(\cos x\right)}^{3} \cdot \color{blue}{{\left(\cos x\right)}^{3}}\right)}}{\mathsf{fma}\left(\cos y, \cos x + \cos y, \cos x \cdot \cos x\right)}}{3 \cdot \left(\left(1 + \frac{\sqrt{5} - 1}{2} \cdot \cos x\right) + \frac{3 - \sqrt{5}}{2} \cdot \cos y\right)}\]
  15. Final simplification0.5

    \[\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 \frac{\frac{\mathsf{fma}\left({\left(\cos y\right)}^{3}, {\left(\cos x\right)}^{3} + {\left(\cos y\right)}^{3}, {\left(\cos x\right)}^{6}\right) \cdot \left({\left(\cos x\right)}^{3} - {\left(\cos y\right)}^{3}\right)}{\mathsf{fma}\left({\left(\cos y\right)}^{3}, {\left(\cos x\right)}^{3} + {\left(\cos y\right)}^{3}, {\left(\cos x\right)}^{3} \cdot {\left(\cos x\right)}^{3}\right)}}{\mathsf{fma}\left(\cos y, \cos x + \cos y, \cos x \cdot \cos x\right)}}{3 \cdot \left(\left(1 + \frac{\sqrt{5} - 1}{2} \cdot \cos x\right) + \frac{3 - \sqrt{5}}{2} \cdot \cos y\right)}\]

Reproduce

herbie shell --seed 2020078 +o rules:numerics
(FPCore (x y)
  :name "Diagrams.TwoD.Path.Metafont.Internal:hobbyF from diagrams-contrib-1.3.0.5"
  :precision binary64
  (/ (+ 2 (* (* (* (sqrt 2) (- (sin x) (/ (sin y) 16))) (- (sin y) (/ (sin x) 16))) (- (cos x) (cos y)))) (* 3 (+ (+ 1 (* (/ (- (sqrt 5) 1) 2) (cos x))) (* (/ (- 3 (sqrt 5)) 2) (cos y))))))