Average Error: 0.6 → 0.6
Time: 6.3s
Precision: 64
\[\cos^{-1} \left(\frac{1 - 5 \cdot \left(v \cdot v\right)}{v \cdot v - 1}\right)\]
\[\cos^{-1} \left(\frac{1 - 5 \cdot \left(v \cdot v\right)}{\mathsf{fma}\left(-1, 1, {v}^{4}\right)} \cdot \left(v \cdot v + 1\right)\right)\]
\cos^{-1} \left(\frac{1 - 5 \cdot \left(v \cdot v\right)}{v \cdot v - 1}\right)
\cos^{-1} \left(\frac{1 - 5 \cdot \left(v \cdot v\right)}{\mathsf{fma}\left(-1, 1, {v}^{4}\right)} \cdot \left(v \cdot v + 1\right)\right)
double code(double v) {
	return acos(((1.0 - (5.0 * (v * v))) / ((v * v) - 1.0)));
}
double code(double v) {
	return acos((((1.0 - (5.0 * (v * v))) / fma(-1.0, 1.0, pow(v, 4.0))) * ((v * v) + 1.0)));
}

Error

Bits error versus v

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 0.6

    \[\cos^{-1} \left(\frac{1 - 5 \cdot \left(v \cdot v\right)}{v \cdot v - 1}\right)\]
  2. Using strategy rm
  3. Applied flip--0.6

    \[\leadsto \cos^{-1} \left(\frac{1 - 5 \cdot \left(v \cdot v\right)}{\color{blue}{\frac{\left(v \cdot v\right) \cdot \left(v \cdot v\right) - 1 \cdot 1}{v \cdot v + 1}}}\right)\]
  4. Applied associate-/r/0.6

    \[\leadsto \cos^{-1} \color{blue}{\left(\frac{1 - 5 \cdot \left(v \cdot v\right)}{\left(v \cdot v\right) \cdot \left(v \cdot v\right) - 1 \cdot 1} \cdot \left(v \cdot v + 1\right)\right)}\]
  5. Simplified0.6

    \[\leadsto \cos^{-1} \left(\color{blue}{\frac{1 - 5 \cdot \left(v \cdot v\right)}{\mathsf{fma}\left(-1, 1, {v}^{4}\right)}} \cdot \left(v \cdot v + 1\right)\right)\]
  6. Final simplification0.6

    \[\leadsto \cos^{-1} \left(\frac{1 - 5 \cdot \left(v \cdot v\right)}{\mathsf{fma}\left(-1, 1, {v}^{4}\right)} \cdot \left(v \cdot v + 1\right)\right)\]

Reproduce

herbie shell --seed 2020078 +o rules:numerics
(FPCore (v)
  :name "Falkner and Boettcher, Appendix B, 1"
  :precision binary64
  (acos (/ (- 1 (* 5 (* v v))) (- (* v v) 1))))