Average Error: 0.0 → 0.0
Time: 3.4s
Precision: 64
\[\left(\frac{\sqrt{2}}{4} \cdot \sqrt{1 - 3 \cdot \left(v \cdot v\right)}\right) \cdot \left(1 - v \cdot v\right)\]
\[\frac{\frac{\sqrt{2}}{4} \cdot \left(\left(\sqrt{{1}^{3} - {\left(3 \cdot \left(v \cdot v\right)\right)}^{3}} \cdot \mathsf{fma}\left(v, v, 1\right)\right) \cdot \left(1 - v \cdot v\right)\right)}{\left(1 + v \cdot v\right) \cdot \sqrt{1 \cdot 1 + \left(\left(3 \cdot \left(v \cdot v\right)\right) \cdot \left(3 \cdot \left(v \cdot v\right)\right) + 1 \cdot \left(3 \cdot \left(v \cdot v\right)\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)
\frac{\frac{\sqrt{2}}{4} \cdot \left(\left(\sqrt{{1}^{3} - {\left(3 \cdot \left(v \cdot v\right)\right)}^{3}} \cdot \mathsf{fma}\left(v, v, 1\right)\right) \cdot \left(1 - v \cdot v\right)\right)}{\left(1 + v \cdot v\right) \cdot \sqrt{1 \cdot 1 + \left(\left(3 \cdot \left(v \cdot v\right)\right) \cdot \left(3 \cdot \left(v \cdot v\right)\right) + 1 \cdot \left(3 \cdot \left(v \cdot v\right)\right)\right)}}
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) / 4.0) * ((sqrt((pow(1.0, 3.0) - pow((3.0 * (v * v)), 3.0))) * fma(v, v, 1.0)) * (1.0 - (v * v)))) / ((1.0 + (v * v)) * sqrt(((1.0 * 1.0) + (((3.0 * (v * v)) * (3.0 * (v * v))) + (1.0 * (3.0 * (v * v))))))));
}

Error

Bits error versus v

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

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. Using strategy rm
  3. Applied associate-*l*0.0

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

    \[\leadsto \frac{\sqrt{2}}{4} \cdot \color{blue}{\left(\left(1 - v \cdot v\right) \cdot \sqrt{1 - 3 \cdot \left(v \cdot v\right)}\right)}\]
  5. Using strategy rm
  6. Applied flip3--0.0

    \[\leadsto \frac{\sqrt{2}}{4} \cdot \left(\left(1 - v \cdot v\right) \cdot \sqrt{\color{blue}{\frac{{1}^{3} - {\left(3 \cdot \left(v \cdot v\right)\right)}^{3}}{1 \cdot 1 + \left(\left(3 \cdot \left(v \cdot v\right)\right) \cdot \left(3 \cdot \left(v \cdot v\right)\right) + 1 \cdot \left(3 \cdot \left(v \cdot v\right)\right)\right)}}}\right)\]
  7. Applied sqrt-div0.0

    \[\leadsto \frac{\sqrt{2}}{4} \cdot \left(\left(1 - v \cdot v\right) \cdot \color{blue}{\frac{\sqrt{{1}^{3} - {\left(3 \cdot \left(v \cdot v\right)\right)}^{3}}}{\sqrt{1 \cdot 1 + \left(\left(3 \cdot \left(v \cdot v\right)\right) \cdot \left(3 \cdot \left(v \cdot v\right)\right) + 1 \cdot \left(3 \cdot \left(v \cdot v\right)\right)\right)}}}\right)\]
  8. Applied flip--0.0

    \[\leadsto \frac{\sqrt{2}}{4} \cdot \left(\color{blue}{\frac{1 \cdot 1 - \left(v \cdot v\right) \cdot \left(v \cdot v\right)}{1 + v \cdot v}} \cdot \frac{\sqrt{{1}^{3} - {\left(3 \cdot \left(v \cdot v\right)\right)}^{3}}}{\sqrt{1 \cdot 1 + \left(\left(3 \cdot \left(v \cdot v\right)\right) \cdot \left(3 \cdot \left(v \cdot v\right)\right) + 1 \cdot \left(3 \cdot \left(v \cdot v\right)\right)\right)}}\right)\]
  9. Applied frac-times0.0

    \[\leadsto \frac{\sqrt{2}}{4} \cdot \color{blue}{\frac{\left(1 \cdot 1 - \left(v \cdot v\right) \cdot \left(v \cdot v\right)\right) \cdot \sqrt{{1}^{3} - {\left(3 \cdot \left(v \cdot v\right)\right)}^{3}}}{\left(1 + v \cdot v\right) \cdot \sqrt{1 \cdot 1 + \left(\left(3 \cdot \left(v \cdot v\right)\right) \cdot \left(3 \cdot \left(v \cdot v\right)\right) + 1 \cdot \left(3 \cdot \left(v \cdot v\right)\right)\right)}}}\]
  10. Applied associate-*r/0.0

    \[\leadsto \color{blue}{\frac{\frac{\sqrt{2}}{4} \cdot \left(\left(1 \cdot 1 - \left(v \cdot v\right) \cdot \left(v \cdot v\right)\right) \cdot \sqrt{{1}^{3} - {\left(3 \cdot \left(v \cdot v\right)\right)}^{3}}\right)}{\left(1 + v \cdot v\right) \cdot \sqrt{1 \cdot 1 + \left(\left(3 \cdot \left(v \cdot v\right)\right) \cdot \left(3 \cdot \left(v \cdot v\right)\right) + 1 \cdot \left(3 \cdot \left(v \cdot v\right)\right)\right)}}}\]
  11. Simplified0.0

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

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

Reproduce

herbie shell --seed 2020078 +o rules:numerics
(FPCore (v)
  :name "Falkner and Boettcher, Appendix B, 2"
  :precision binary64
  (* (* (/ (sqrt 2) 4) (sqrt (- 1 (* 3 (* v v))))) (- 1 (* v v))))