Average Error: 0.6 → 0.7
Time: 42.7s
Precision: binary64
Cost: 13440
\[\cos^{-1} \left(\frac{1 - 5 \cdot \left(v \cdot v\right)}{v \cdot v - 1}\right)\]
\[\cos^{-1} \left(-1 + v \cdot \left(4 \cdot \left(v + {v}^{3}\right)\right)\right)\]
\cos^{-1} \left(\frac{1 - 5 \cdot \left(v \cdot v\right)}{v \cdot v - 1}\right)
\cos^{-1} \left(-1 + v \cdot \left(4 \cdot \left(v + {v}^{3}\right)\right)\right)
(FPCore (v)
 :precision binary64
 (acos (/ (- 1.0 (* 5.0 (* v v))) (- (* v v) 1.0))))
(FPCore (v)
 :precision binary64
 (acos (+ -1.0 (* v (* 4.0 (+ v (pow v 3.0)))))))
double code(double v) {
	return acos((1.0 - (5.0 * (v * v))) / ((v * v) - 1.0));
}
double code(double v) {
	return acos(-1.0 + (v * (4.0 * (v + pow(v, 3.0)))));
}

Error

Bits error versus v

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Alternatives

Alternative 1
Error0.6
Cost7232
\[\cos^{-1} \left(\frac{1 - 5 \cdot \left(v \cdot v\right)}{-1 + v \cdot v}\right)\]
Alternative 2
Error0.9
Cost6848
\[\cos^{-1} \left(-1 + 4 \cdot \left(v \cdot v\right)\right)\]
Alternative 3
Error1.3
Cost6464
\[\cos^{-1} -1\]
Alternative 4
Error52.7
Cost64
\[1\]

Error

Time

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}^{4} + 4 \cdot {v}^{2}\right) - 1\right)}\]
  3. Simplified0.7

    \[\leadsto \cos^{-1} \color{blue}{\left(-1 + v \cdot \left(\left(v + {v}^{3}\right) \cdot 4\right)\right)}\]
  4. Using strategy rm
  5. Applied add-sqr-sqrt_binary64_24870.7

    \[\leadsto \cos^{-1} \left(-1 + \color{blue}{\sqrt{v \cdot \left(\left(v + {v}^{3}\right) \cdot 4\right)} \cdot \sqrt{v \cdot \left(\left(v + {v}^{3}\right) \cdot 4\right)}}\right)\]
  6. Taylor expanded around 0 0.7

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

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

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

    \[\leadsto \cos^{-1} \left(-1 + v \cdot \left(4 \cdot \left(v + {v}^{3}\right)\right)\right)\]

Reproduce

herbie shell --seed 2021045 
(FPCore (v)
  :name "Falkner and Boettcher, Appendix B, 1"
  :precision binary64
  (acos (/ (- 1.0 (* 5.0 (* v v))) (- (* v v) 1.0))))