Average Error: 0.5 → 0.4
Time: 22.7s
Precision: binary64
\[\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)} \]
\[\begin{array}{l} t_0 := e^{\cos y}\\ \frac{\mathsf{fma}\left(\left(\sqrt{2} \cdot \sin x - \sqrt{2} \cdot \frac{\sin y}{{\left(\sqrt[3]{16}\right)}^{3}}\right) \cdot \left(\sin y - \frac{\sin x}{16}\right), \mathsf{fma}\left(-0.5, \log t_0, \log \left(\frac{e^{\cos x}}{\sqrt{t_0}}\right)\right), 2\right)}{\mathsf{fma}\left(\cos x, \frac{\sqrt{5} - 1}{0.6666666666666666}, \mathsf{fma}\left(\cos y, 1.5 \cdot \left(3 - \sqrt{5}\right), 3\right)\right)} \end{array} \]
\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)}
\begin{array}{l}
t_0 := e^{\cos y}\\
\frac{\mathsf{fma}\left(\left(\sqrt{2} \cdot \sin x - \sqrt{2} \cdot \frac{\sin y}{{\left(\sqrt[3]{16}\right)}^{3}}\right) \cdot \left(\sin y - \frac{\sin x}{16}\right), \mathsf{fma}\left(-0.5, \log t_0, \log \left(\frac{e^{\cos x}}{\sqrt{t_0}}\right)\right), 2\right)}{\mathsf{fma}\left(\cos x, \frac{\sqrt{5} - 1}{0.6666666666666666}, \mathsf{fma}\left(\cos y, 1.5 \cdot \left(3 - \sqrt{5}\right), 3\right)\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))))))
(FPCore (x y)
 :precision binary64
 (let* ((t_0 (exp (cos y))))
   (/
    (fma
     (*
      (-
       (* (sqrt 2.0) (sin x))
       (* (sqrt 2.0) (/ (sin y) (pow (cbrt 16.0) 3.0))))
      (- (sin y) (/ (sin x) 16.0)))
     (fma -0.5 (log t_0) (log (/ (exp (cos x)) (sqrt t_0))))
     2.0)
    (fma
     (cos x)
     (/ (- (sqrt 5.0) 1.0) 0.6666666666666666)
     (fma (cos y) (* 1.5 (- 3.0 (sqrt 5.0))) 3.0)))))
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) {
	double t_0 = exp(cos(y));
	return fma((((sqrt(2.0) * sin(x)) - (sqrt(2.0) * (sin(y) / pow(cbrt(16.0), 3.0)))) * (sin(y) - (sin(x) / 16.0))), fma(-0.5, log(t_0), log(exp(cos(x)) / sqrt(t_0))), 2.0) / fma(cos(x), ((sqrt(5.0) - 1.0) / 0.6666666666666666), fma(cos(y), (1.5 * (3.0 - sqrt(5.0))), 3.0));
}

Error

Bits error versus x

Bits error versus y

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. Simplified0.4

    \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(\left(\sqrt{2} \cdot \left(\sin x - \frac{\sin y}{16}\right)\right) \cdot \left(\sin y - \frac{\sin x}{16}\right), \cos x - \cos y, 2\right)}{\mathsf{fma}\left(\cos x, \frac{\sqrt{5} - 1}{0.6666666666666666}, \mathsf{fma}\left(\cos y, 1.5 \cdot \left(3 - \sqrt{5}\right), 3\right)\right)}} \]
  3. Applied add-cube-cbrt_binary640.4

    \[\leadsto \frac{\mathsf{fma}\left(\left(\sqrt{2} \cdot \left(\sin x - \frac{\sin y}{\color{blue}{\left(\sqrt[3]{16} \cdot \sqrt[3]{16}\right) \cdot \sqrt[3]{16}}}\right)\right) \cdot \left(\sin y - \frac{\sin x}{16}\right), \cos x - \cos y, 2\right)}{\mathsf{fma}\left(\cos x, \frac{\sqrt{5} - 1}{0.6666666666666666}, \mathsf{fma}\left(\cos y, 1.5 \cdot \left(3 - \sqrt{5}\right), 3\right)\right)} \]
  4. Applied add-cube-cbrt_binary640.4

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

    \[\leadsto \frac{\mathsf{fma}\left(\left(\sqrt{2} \cdot \left(\sin x - \color{blue}{\frac{\sqrt[3]{\sin y} \cdot \sqrt[3]{\sin y}}{\sqrt[3]{16} \cdot \sqrt[3]{16}} \cdot \frac{\sqrt[3]{\sin y}}{\sqrt[3]{16}}}\right)\right) \cdot \left(\sin y - \frac{\sin x}{16}\right), \cos x - \cos y, 2\right)}{\mathsf{fma}\left(\cos x, \frac{\sqrt{5} - 1}{0.6666666666666666}, \mathsf{fma}\left(\cos y, 1.5 \cdot \left(3 - \sqrt{5}\right), 3\right)\right)} \]
  6. Applied cancel-sign-sub-inv_binary640.4

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

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

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

    \[\leadsto \frac{\mathsf{fma}\left(\left(\sqrt{2} \cdot \sin x + \color{blue}{\sqrt{2} \cdot \left(-\frac{\sin y}{{\left(\sqrt[3]{16}\right)}^{3}}\right)}\right) \cdot \left(\sin y - \frac{\sin x}{16}\right), \cos x - \cos y, 2\right)}{\mathsf{fma}\left(\cos x, \frac{\sqrt{5} - 1}{0.6666666666666666}, \mathsf{fma}\left(\cos y, 1.5 \cdot \left(3 - \sqrt{5}\right), 3\right)\right)} \]
  10. Applied add-log-exp_binary640.4

    \[\leadsto \frac{\mathsf{fma}\left(\left(\sqrt{2} \cdot \sin x + \sqrt{2} \cdot \left(-\frac{\sin y}{{\left(\sqrt[3]{16}\right)}^{3}}\right)\right) \cdot \left(\sin y - \frac{\sin x}{16}\right), \cos x - \color{blue}{\log \left(e^{\cos y}\right)}, 2\right)}{\mathsf{fma}\left(\cos x, \frac{\sqrt{5} - 1}{0.6666666666666666}, \mathsf{fma}\left(\cos y, 1.5 \cdot \left(3 - \sqrt{5}\right), 3\right)\right)} \]
  11. Applied add-log-exp_binary640.4

    \[\leadsto \frac{\mathsf{fma}\left(\left(\sqrt{2} \cdot \sin x + \sqrt{2} \cdot \left(-\frac{\sin y}{{\left(\sqrt[3]{16}\right)}^{3}}\right)\right) \cdot \left(\sin y - \frac{\sin x}{16}\right), \color{blue}{\log \left(e^{\cos x}\right)} - \log \left(e^{\cos y}\right), 2\right)}{\mathsf{fma}\left(\cos x, \frac{\sqrt{5} - 1}{0.6666666666666666}, \mathsf{fma}\left(\cos y, 1.5 \cdot \left(3 - \sqrt{5}\right), 3\right)\right)} \]
  12. Applied diff-log_binary640.4

    \[\leadsto \frac{\mathsf{fma}\left(\left(\sqrt{2} \cdot \sin x + \sqrt{2} \cdot \left(-\frac{\sin y}{{\left(\sqrt[3]{16}\right)}^{3}}\right)\right) \cdot \left(\sin y - \frac{\sin x}{16}\right), \color{blue}{\log \left(\frac{e^{\cos x}}{e^{\cos y}}\right)}, 2\right)}{\mathsf{fma}\left(\cos x, \frac{\sqrt{5} - 1}{0.6666666666666666}, \mathsf{fma}\left(\cos y, 1.5 \cdot \left(3 - \sqrt{5}\right), 3\right)\right)} \]
  13. Applied add-sqr-sqrt_binary640.4

    \[\leadsto \frac{\mathsf{fma}\left(\left(\sqrt{2} \cdot \sin x + \sqrt{2} \cdot \left(-\frac{\sin y}{{\left(\sqrt[3]{16}\right)}^{3}}\right)\right) \cdot \left(\sin y - \frac{\sin x}{16}\right), \log \left(\frac{e^{\cos x}}{\color{blue}{\sqrt{e^{\cos y}} \cdot \sqrt{e^{\cos y}}}}\right), 2\right)}{\mathsf{fma}\left(\cos x, \frac{\sqrt{5} - 1}{0.6666666666666666}, \mathsf{fma}\left(\cos y, 1.5 \cdot \left(3 - \sqrt{5}\right), 3\right)\right)} \]
  14. Applied *-un-lft-identity_binary640.4

    \[\leadsto \frac{\mathsf{fma}\left(\left(\sqrt{2} \cdot \sin x + \sqrt{2} \cdot \left(-\frac{\sin y}{{\left(\sqrt[3]{16}\right)}^{3}}\right)\right) \cdot \left(\sin y - \frac{\sin x}{16}\right), \log \left(\frac{\color{blue}{1 \cdot e^{\cos x}}}{\sqrt{e^{\cos y}} \cdot \sqrt{e^{\cos y}}}\right), 2\right)}{\mathsf{fma}\left(\cos x, \frac{\sqrt{5} - 1}{0.6666666666666666}, \mathsf{fma}\left(\cos y, 1.5 \cdot \left(3 - \sqrt{5}\right), 3\right)\right)} \]
  15. Applied times-frac_binary640.4

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

    \[\leadsto \frac{\mathsf{fma}\left(\left(\sqrt{2} \cdot \sin x + \sqrt{2} \cdot \left(-\frac{\sin y}{{\left(\sqrt[3]{16}\right)}^{3}}\right)\right) \cdot \left(\sin y - \frac{\sin x}{16}\right), \color{blue}{\log \left(\frac{1}{\sqrt{e^{\cos y}}}\right) + \log \left(\frac{e^{\cos x}}{\sqrt{e^{\cos y}}}\right)}, 2\right)}{\mathsf{fma}\left(\cos x, \frac{\sqrt{5} - 1}{0.6666666666666666}, \mathsf{fma}\left(\cos y, 1.5 \cdot \left(3 - \sqrt{5}\right), 3\right)\right)} \]
  17. Applied pow1/2_binary640.4

    \[\leadsto \frac{\mathsf{fma}\left(\left(\sqrt{2} \cdot \sin x + \sqrt{2} \cdot \left(-\frac{\sin y}{{\left(\sqrt[3]{16}\right)}^{3}}\right)\right) \cdot \left(\sin y - \frac{\sin x}{16}\right), \log \left(\frac{1}{\color{blue}{{\left(e^{\cos y}\right)}^{0.5}}}\right) + \log \left(\frac{e^{\cos x}}{\sqrt{e^{\cos y}}}\right), 2\right)}{\mathsf{fma}\left(\cos x, \frac{\sqrt{5} - 1}{0.6666666666666666}, \mathsf{fma}\left(\cos y, 1.5 \cdot \left(3 - \sqrt{5}\right), 3\right)\right)} \]
  18. Applied pow-flip_binary640.4

    \[\leadsto \frac{\mathsf{fma}\left(\left(\sqrt{2} \cdot \sin x + \sqrt{2} \cdot \left(-\frac{\sin y}{{\left(\sqrt[3]{16}\right)}^{3}}\right)\right) \cdot \left(\sin y - \frac{\sin x}{16}\right), \log \color{blue}{\left({\left(e^{\cos y}\right)}^{\left(-0.5\right)}\right)} + \log \left(\frac{e^{\cos x}}{\sqrt{e^{\cos y}}}\right), 2\right)}{\mathsf{fma}\left(\cos x, \frac{\sqrt{5} - 1}{0.6666666666666666}, \mathsf{fma}\left(\cos y, 1.5 \cdot \left(3 - \sqrt{5}\right), 3\right)\right)} \]
  19. Applied log-pow_binary640.4

    \[\leadsto \frac{\mathsf{fma}\left(\left(\sqrt{2} \cdot \sin x + \sqrt{2} \cdot \left(-\frac{\sin y}{{\left(\sqrt[3]{16}\right)}^{3}}\right)\right) \cdot \left(\sin y - \frac{\sin x}{16}\right), \color{blue}{\left(-0.5\right) \cdot \log \left(e^{\cos y}\right)} + \log \left(\frac{e^{\cos x}}{\sqrt{e^{\cos y}}}\right), 2\right)}{\mathsf{fma}\left(\cos x, \frac{\sqrt{5} - 1}{0.6666666666666666}, \mathsf{fma}\left(\cos y, 1.5 \cdot \left(3 - \sqrt{5}\right), 3\right)\right)} \]
  20. Applied fma-def_binary640.4

    \[\leadsto \frac{\mathsf{fma}\left(\left(\sqrt{2} \cdot \sin x + \sqrt{2} \cdot \left(-\frac{\sin y}{{\left(\sqrt[3]{16}\right)}^{3}}\right)\right) \cdot \left(\sin y - \frac{\sin x}{16}\right), \color{blue}{\mathsf{fma}\left(-0.5, \log \left(e^{\cos y}\right), \log \left(\frac{e^{\cos x}}{\sqrt{e^{\cos y}}}\right)\right)}, 2\right)}{\mathsf{fma}\left(\cos x, \frac{\sqrt{5} - 1}{0.6666666666666666}, \mathsf{fma}\left(\cos y, 1.5 \cdot \left(3 - \sqrt{5}\right), 3\right)\right)} \]
  21. Final simplification0.4

    \[\leadsto \frac{\mathsf{fma}\left(\left(\sqrt{2} \cdot \sin x - \sqrt{2} \cdot \frac{\sin y}{{\left(\sqrt[3]{16}\right)}^{3}}\right) \cdot \left(\sin y - \frac{\sin x}{16}\right), \mathsf{fma}\left(-0.5, \log \left(e^{\cos y}\right), \log \left(\frac{e^{\cos x}}{\sqrt{e^{\cos y}}}\right)\right), 2\right)}{\mathsf{fma}\left(\cos x, \frac{\sqrt{5} - 1}{0.6666666666666666}, \mathsf{fma}\left(\cos y, 1.5 \cdot \left(3 - \sqrt{5}\right), 3\right)\right)} \]

Reproduce

herbie shell --seed 2022088 
(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))))))