Average Error: 0.0 → 0.0
Time: 2.9s
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) \]
\[\begin{array}{l} t_0 := \sqrt{\mathsf{fma}\left(v, v \cdot -3, 1\right)}\\ \mathsf{fma}\left(\sqrt{2}, t_0 \cdot \left(\left(v \cdot v\right) \cdot -0.25\right), \sqrt{2} \cdot \left(t_0 \cdot 0.25\right)\right) \end{array} \]
\left(\frac{\sqrt{2}}{4} \cdot \sqrt{1 - 3 \cdot \left(v \cdot v\right)}\right) \cdot \left(1 - v \cdot v\right)
\begin{array}{l}
t_0 := \sqrt{\mathsf{fma}\left(v, v \cdot -3, 1\right)}\\
\mathsf{fma}\left(\sqrt{2}, t_0 \cdot \left(\left(v \cdot v\right) \cdot -0.25\right), \sqrt{2} \cdot \left(t_0 \cdot 0.25\right)\right)
\end{array}
(FPCore (v)
 :precision binary64
 (* (* (/ (sqrt 2.0) 4.0) (sqrt (- 1.0 (* 3.0 (* v v))))) (- 1.0 (* v v))))
(FPCore (v)
 :precision binary64
 (let* ((t_0 (sqrt (fma v (* v -3.0) 1.0))))
   (fma (sqrt 2.0) (* t_0 (* (* v v) -0.25)) (* (sqrt 2.0) (* t_0 0.25)))))
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) {
	double t_0 = sqrt(fma(v, (v * -3.0), 1.0));
	return fma(sqrt(2.0), (t_0 * ((v * v) * -0.25)), (sqrt(2.0) * (t_0 * 0.25)));
}

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 fma-udef_binary640.0

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

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

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

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

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

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

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

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

Reproduce

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