Average Error: 0.5 → 0.4
Time: 18.3s
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)} \]
\[\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), \frac{\cos x \cdot \cos x - \cos y \cdot \cos y}{\cos x + \cos y}, 2\right)}{\mathsf{fma}\left(\cos x, \frac{1}{\sqrt{0.6666666666666666}} \cdot \frac{\sqrt{5} - 1}{\sqrt{0.6666666666666666}}, \mathsf{fma}\left(\cos y, 1.5 \cdot \frac{4}{\sqrt{5} + 3}, 3\right)\right)} \]
(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
 (/
  (fma
   (* (* (sqrt 2.0) (- (sin x) (/ (sin y) 16.0))) (- (sin y) (/ (sin x) 16.0)))
   (/ (- (* (cos x) (cos x)) (* (cos y) (cos y))) (+ (cos x) (cos y)))
   2.0)
  (fma
   (cos x)
   (*
    (/ 1.0 (sqrt 0.6666666666666666))
    (/ (- (sqrt 5.0) 1.0) (sqrt 0.6666666666666666)))
   (fma (cos y) (* 1.5 (/ 4.0 (+ (sqrt 5.0) 3.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) {
	return fma(((sqrt(2.0) * (sin(x) - (sin(y) / 16.0))) * (sin(y) - (sin(x) / 16.0))), (((cos(x) * cos(x)) - (cos(y) * cos(y))) / (cos(x) + cos(y))), 2.0) / fma(cos(x), ((1.0 / sqrt(0.6666666666666666)) * ((sqrt(5.0) - 1.0) / sqrt(0.6666666666666666))), fma(cos(y), (1.5 * (4.0 / (sqrt(5.0) + 3.0))), 3.0));
}
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 code(x, y)
	return Float64(fma(Float64(Float64(sqrt(2.0) * Float64(sin(x) - Float64(sin(y) / 16.0))) * Float64(sin(y) - Float64(sin(x) / 16.0))), Float64(Float64(Float64(cos(x) * cos(x)) - Float64(cos(y) * cos(y))) / Float64(cos(x) + cos(y))), 2.0) / fma(cos(x), Float64(Float64(1.0 / sqrt(0.6666666666666666)) * Float64(Float64(sqrt(5.0) - 1.0) / sqrt(0.6666666666666666))), fma(cos(y), Float64(1.5 * Float64(4.0 / Float64(sqrt(5.0) + 3.0))), 3.0)))
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]
code[x_, y_] := N[(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[(N[(N[Cos[x], $MachinePrecision] * N[Cos[x], $MachinePrecision]), $MachinePrecision] - N[(N[Cos[y], $MachinePrecision] * N[Cos[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(N[Cos[x], $MachinePrecision] + N[Cos[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 2.0), $MachinePrecision] / N[(N[Cos[x], $MachinePrecision] * N[(N[(1.0 / N[Sqrt[0.6666666666666666], $MachinePrecision]), $MachinePrecision] * N[(N[(N[Sqrt[5.0], $MachinePrecision] - 1.0), $MachinePrecision] / N[Sqrt[0.6666666666666666], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[Cos[y], $MachinePrecision] * N[(1.5 * N[(4.0 / N[(N[Sqrt[5.0], $MachinePrecision] + 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\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{\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), \frac{\cos x \cdot \cos x - \cos y \cdot \cos y}{\cos x + \cos y}, 2\right)}{\mathsf{fma}\left(\cos x, \frac{1}{\sqrt{0.6666666666666666}} \cdot \frac{\sqrt{5} - 1}{\sqrt{0.6666666666666666}}, \mathsf{fma}\left(\cos y, 1.5 \cdot \frac{4}{\sqrt{5} + 3}, 3\right)\right)}

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-sqr-sqrt_binary640.4

    \[\leadsto \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}{\color{blue}{\sqrt{0.6666666666666666} \cdot \sqrt{0.6666666666666666}}}, \mathsf{fma}\left(\cos y, 1.5 \cdot \left(3 - \sqrt{5}\right), 3\right)\right)} \]
  4. Applied *-un-lft-identity_binary640.4

    \[\leadsto \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{\color{blue}{1 \cdot \left(\sqrt{5} - 1\right)}}{\sqrt{0.6666666666666666} \cdot \sqrt{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 - \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, \color{blue}{\frac{1}{\sqrt{0.6666666666666666}} \cdot \frac{\sqrt{5} - 1}{\sqrt{0.6666666666666666}}}, \mathsf{fma}\left(\cos y, 1.5 \cdot \left(3 - \sqrt{5}\right), 3\right)\right)} \]
  6. Applied flip--_binary640.4

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

    \[\leadsto \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{1}{\sqrt{0.6666666666666666}} \cdot \frac{\sqrt{5} - 1}{\sqrt{0.6666666666666666}}, \mathsf{fma}\left(\cos y, 1.5 \cdot \frac{\color{blue}{4}}{3 + \sqrt{5}}, 3\right)\right)} \]
  8. Applied flip--_binary640.4

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

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

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

Reproduce

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