Average Error: 0.0 → 0.0
Time: 1.8s
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{2 \cdot \mathsf{fma}\left(v, v \cdot -3, 1\right)} \cdot \left(-0.25 \cdot \mathsf{fma}\left(v, v, -1\right)\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{2 \cdot \mathsf{fma}\left(v, v \cdot -3, 1\right)} \cdot \left(-0.25 \cdot \mathsf{fma}\left(v, v, -1\right)\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 (* 2.0 (fma v (* v -3.0) 1.0))) (* -0.25 (fma v v -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(2.0 * fma(v, (v * -3.0), 1.0)) * (-0.25 * fma(v, v, -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. Applied associate-*r*_binary640.0

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

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

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

Reproduce

herbie shell --seed 2022077 
(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))))