Average Error: 0.5 → 0.5
Time: 6.0s
Precision: binary64
\[\cos^{-1} \left(\frac{1 - 5 \cdot \left(v \cdot v\right)}{v \cdot v - 1}\right) \]
\[\cos^{-1} \log \left(e^{\frac{\mathsf{fma}\left(v, v \cdot -5, 1\right)}{\mathsf{fma}\left(v, v, -1\right)}}\right) \]
\cos^{-1} \left(\frac{1 - 5 \cdot \left(v \cdot v\right)}{v \cdot v - 1}\right)
\cos^{-1} \log \left(e^{\frac{\mathsf{fma}\left(v, v \cdot -5, 1\right)}{\mathsf{fma}\left(v, v, -1\right)}}\right)
(FPCore (v)
 :precision binary64
 (acos (/ (- 1.0 (* 5.0 (* v v))) (- (* v v) 1.0))))
(FPCore (v)
 :precision binary64
 (acos (log (exp (/ (fma v (* v -5.0) 1.0) (fma v v -1.0))))))
double code(double v) {
	return acos((1.0 - (5.0 * (v * v))) / ((v * v) - 1.0));
}
double code(double v) {
	return acos(log(exp(fma(v, (v * -5.0), 1.0) / fma(v, v, -1.0))));
}

Error

Bits error versus v

Derivation

  1. Initial program 0.5

    \[\cos^{-1} \left(\frac{1 - 5 \cdot \left(v \cdot v\right)}{v \cdot v - 1}\right) \]
  2. Simplified0.5

    \[\leadsto \color{blue}{\cos^{-1} \left(\frac{\mathsf{fma}\left(v, v \cdot -5, 1\right)}{\mathsf{fma}\left(v, v, -1\right)}\right)} \]
  3. Applied add-log-exp_binary640.5

    \[\leadsto \cos^{-1} \color{blue}{\log \left(e^{\frac{\mathsf{fma}\left(v, v \cdot -5, 1\right)}{\mathsf{fma}\left(v, v, -1\right)}}\right)} \]
  4. Applied *-un-lft-identity_binary640.5

    \[\leadsto \cos^{-1} \log \left(e^{\frac{\mathsf{fma}\left(v, v \cdot -5, 1\right)}{\color{blue}{1 \cdot \mathsf{fma}\left(v, v, -1\right)}}}\right) \]
  5. Applied *-un-lft-identity_binary640.5

    \[\leadsto \cos^{-1} \log \left(e^{\frac{\color{blue}{1 \cdot \mathsf{fma}\left(v, v \cdot -5, 1\right)}}{1 \cdot \mathsf{fma}\left(v, v, -1\right)}}\right) \]
  6. Applied times-frac_binary640.5

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

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

Reproduce

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