Average Error: 15.0 → 10.8
Time: 29.4s
Precision: 64
Internal Precision: 2368
\[\cos^{-1} \left(x1 \cdot y1 + \frac{x2 \cdot y2}{\sqrt{x1^2 + x2^2}^* \cdot \sqrt{y1^2 + y2^2}^*}\right)\]
\[\cos^{-1} \left(\frac{x2}{\sqrt{x1^2 + x2^2}^*} \cdot \frac{y2}{\sqrt{y1^2 + y2^2}^*} + x1 \cdot y1\right)\]

Error

Bits error versus x1

Bits error versus y1

Bits error versus x2

Bits error versus y2

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 15.0

    \[\cos^{-1} \left(x1 \cdot y1 + \frac{x2 \cdot y2}{\sqrt{x1^2 + x2^2}^* \cdot \sqrt{y1^2 + y2^2}^*}\right)\]
  2. Using strategy rm
  3. Applied times-frac10.8

    \[\leadsto \cos^{-1} \left(x1 \cdot y1 + \color{blue}{\frac{x2}{\sqrt{x1^2 + x2^2}^*} \cdot \frac{y2}{\sqrt{y1^2 + y2^2}^*}}\right)\]
  4. Final simplification10.8

    \[\leadsto \cos^{-1} \left(\frac{x2}{\sqrt{x1^2 + x2^2}^*} \cdot \frac{y2}{\sqrt{y1^2 + y2^2}^*} + x1 \cdot y1\right)\]

Runtime

Time bar (total: 29.4s)Debug log

herbie shell --seed '#(2775764126 3555076145 3898259844 1891440260 2599947619 1948460636)' 
(FPCore (x1 y1 x2 y2)
  :name "acos(x1 * y1 + x2 * y2 / (hypot(x1, x2) * hypot(y1, y2)))"
  (acos (+ (* x1 y1) (/ (* x2 y2) (* (hypot x1 x2) (hypot y1 y2))))))