Average Error: 0.6 → 0.7
Time: 4.9s
Precision: 64
\[\cos^{-1} \left(\frac{1 - 5 \cdot \left(v \cdot v\right)}{v \cdot v - 1}\right)\]
\[{\left(e^{\sqrt{\log \left(\cos^{-1} \left(\mathsf{fma}\left(4, \mathsf{fma}\left(v, v, {v}^{4}\right), -1\right)\right)\right)}}\right)}^{\left(\sqrt{\log \left(\cos^{-1} \left(\mathsf{fma}\left(4, \mathsf{fma}\left(v, v, {v}^{4}\right), -1\right)\right)\right)}\right)}\]
\cos^{-1} \left(\frac{1 - 5 \cdot \left(v \cdot v\right)}{v \cdot v - 1}\right)
{\left(e^{\sqrt{\log \left(\cos^{-1} \left(\mathsf{fma}\left(4, \mathsf{fma}\left(v, v, {v}^{4}\right), -1\right)\right)\right)}}\right)}^{\left(\sqrt{\log \left(\cos^{-1} \left(\mathsf{fma}\left(4, \mathsf{fma}\left(v, v, {v}^{4}\right), -1\right)\right)\right)}\right)}
double code(double v) {
	return ((double) acos(((double) (((double) (1.0 - ((double) (5.0 * ((double) (v * v)))))) / ((double) (((double) (v * v)) - 1.0))))));
}
double code(double v) {
	return ((double) pow(((double) exp(((double) sqrt(((double) log(((double) acos(((double) fma(4.0, ((double) fma(v, v, ((double) pow(v, 4.0)))), ((double) -(1.0)))))))))))), ((double) sqrt(((double) log(((double) acos(((double) fma(4.0, ((double) fma(v, v, ((double) pow(v, 4.0)))), ((double) -(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. Taylor expanded around 0 0.7

    \[\leadsto \cos^{-1} \color{blue}{\left(\left(4 \cdot {v}^{2} + 4 \cdot {v}^{4}\right) - 1\right)}\]
  3. Simplified0.7

    \[\leadsto \cos^{-1} \color{blue}{\left(\mathsf{fma}\left(4, \mathsf{fma}\left(v, v, {v}^{4}\right), -1\right)\right)}\]
  4. Using strategy rm
  5. Applied add-exp-log0.7

    \[\leadsto \color{blue}{e^{\log \left(\cos^{-1} \left(\mathsf{fma}\left(4, \mathsf{fma}\left(v, v, {v}^{4}\right), -1\right)\right)\right)}}\]
  6. Using strategy rm
  7. Applied add-sqr-sqrt0.7

    \[\leadsto e^{\color{blue}{\sqrt{\log \left(\cos^{-1} \left(\mathsf{fma}\left(4, \mathsf{fma}\left(v, v, {v}^{4}\right), -1\right)\right)\right)} \cdot \sqrt{\log \left(\cos^{-1} \left(\mathsf{fma}\left(4, \mathsf{fma}\left(v, v, {v}^{4}\right), -1\right)\right)\right)}}}\]
  8. Applied exp-prod0.7

    \[\leadsto \color{blue}{{\left(e^{\sqrt{\log \left(\cos^{-1} \left(\mathsf{fma}\left(4, \mathsf{fma}\left(v, v, {v}^{4}\right), -1\right)\right)\right)}}\right)}^{\left(\sqrt{\log \left(\cos^{-1} \left(\mathsf{fma}\left(4, \mathsf{fma}\left(v, v, {v}^{4}\right), -1\right)\right)\right)}\right)}}\]
  9. Final simplification0.7

    \[\leadsto {\left(e^{\sqrt{\log \left(\cos^{-1} \left(\mathsf{fma}\left(4, \mathsf{fma}\left(v, v, {v}^{4}\right), -1\right)\right)\right)}}\right)}^{\left(\sqrt{\log \left(\cos^{-1} \left(\mathsf{fma}\left(4, \mathsf{fma}\left(v, v, {v}^{4}\right), -1\right)\right)\right)}\right)}\]

Reproduce

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