Average Error: 0.0 → 0.0
Time: 2.3s
Precision: binary64
\[\left(\frac{\sqrt{2}}{4} \cdot \sqrt{1 - 3 \cdot \left(v \cdot v\right)}\right) \cdot \left(1 - v \cdot v\right) \]
\[\sqrt{\left(0.125 \cdot {\left(\mathsf{fma}\left(v, v, -1\right)\right)}^{2}\right) \cdot \mathsf{fma}\left(v, v \cdot -3, 1\right)} \]
\left(\frac{\sqrt{2}}{4} \cdot \sqrt{1 - 3 \cdot \left(v \cdot v\right)}\right) \cdot \left(1 - v \cdot v\right)
\sqrt{\left(0.125 \cdot {\left(\mathsf{fma}\left(v, v, -1\right)\right)}^{2}\right) \cdot \mathsf{fma}\left(v, v \cdot -3, 1\right)}
(FPCore (v)
 :precision binary64
 (* (* (/ (sqrt 2.0) 4.0) (sqrt (- 1.0 (* 3.0 (* v v))))) (- 1.0 (* v v))))
(FPCore (v)
 :precision binary64
 (sqrt (* (* 0.125 (pow (fma v v -1.0) 2.0)) (fma v (* v -3.0) 1.0))))
double code(double v) {
	return ((sqrt(2.0) / 4.0) * sqrt(1.0 - (3.0 * (v * v)))) * (1.0 - (v * v));
}
double code(double v) {
	return sqrt((0.125 * pow(fma(v, v, -1.0), 2.0)) * fma(v, (v * -3.0), 1.0));
}

Error

Bits error versus v

Derivation

  1. Initial program 0.0

    \[\left(\frac{\sqrt{2}}{4} \cdot \sqrt{1 - 3 \cdot \left(v \cdot v\right)}\right) \cdot \left(1 - v \cdot v\right) \]
  2. Simplified0.0

    \[\leadsto \color{blue}{\sqrt{2} \cdot \left(\sqrt{\mathsf{fma}\left(v, v \cdot -3, 1\right)} \cdot \left(-0.25 \cdot \mathsf{fma}\left(v, v, -1\right)\right)\right)} \]
  3. Using strategy rm
  4. Applied add-sqr-sqrt_binary641.0

    \[\leadsto \color{blue}{\sqrt{\sqrt{2} \cdot \left(\sqrt{\mathsf{fma}\left(v, v \cdot -3, 1\right)} \cdot \left(-0.25 \cdot \mathsf{fma}\left(v, v, -1\right)\right)\right)} \cdot \sqrt{\sqrt{2} \cdot \left(\sqrt{\mathsf{fma}\left(v, v \cdot -3, 1\right)} \cdot \left(-0.25 \cdot \mathsf{fma}\left(v, v, -1\right)\right)\right)}} \]
  5. Applied sqrt-unprod_binary640.0

    \[\leadsto \color{blue}{\sqrt{\left(\sqrt{2} \cdot \left(\sqrt{\mathsf{fma}\left(v, v \cdot -3, 1\right)} \cdot \left(-0.25 \cdot \mathsf{fma}\left(v, v, -1\right)\right)\right)\right) \cdot \left(\sqrt{2} \cdot \left(\sqrt{\mathsf{fma}\left(v, v \cdot -3, 1\right)} \cdot \left(-0.25 \cdot \mathsf{fma}\left(v, v, -1\right)\right)\right)\right)}} \]
  6. Simplified0.0

    \[\leadsto \sqrt{\color{blue}{{\left(-0.25 \cdot \mathsf{fma}\left(v, v, -1\right)\right)}^{2} \cdot \left(2 \cdot \mathsf{fma}\left(v, v \cdot -3, 1\right)\right)}} \]
  7. Using strategy rm
  8. Applied associate-*r*_binary640.0

    \[\leadsto \sqrt{\color{blue}{\left({\left(-0.25 \cdot \mathsf{fma}\left(v, v, -1\right)\right)}^{2} \cdot 2\right) \cdot \mathsf{fma}\left(v, v \cdot -3, 1\right)}} \]
  9. Simplified0.0

    \[\leadsto \sqrt{\color{blue}{\left(0.125 \cdot {\left(\mathsf{fma}\left(v, v, -1\right)\right)}^{2}\right)} \cdot \mathsf{fma}\left(v, v \cdot -3, 1\right)} \]
  10. Final simplification0.0

    \[\leadsto \sqrt{\left(0.125 \cdot {\left(\mathsf{fma}\left(v, v, -1\right)\right)}^{2}\right) \cdot \mathsf{fma}\left(v, v \cdot -3, 1\right)} \]

Reproduce

herbie shell --seed 2021211 
(FPCore (v)
  :name "Falkner and Boettcher, Appendix B, 2"
  :precision binary64
  (* (* (/ (sqrt 2.0) 4.0) (sqrt (- 1.0 (* 3.0 (* v v))))) (- 1.0 (* v v))))