Average Error: 0.0 → 0.0
Time: 2.0s
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{\mathsf{fma}\left(v, v \cdot -3, 1\right) \cdot \left(2 \cdot \left({\left(\mathsf{fma}\left(v, v, -1\right)\right)}^{2} \cdot 0.0625\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 (* (fma v (* v -3.0) 1.0) (* 2.0 (* (pow (fma v v -1.0) 2.0) 0.0625)))))
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((fma(v, (v * -3.0), 1.0) * (2.0 * (pow(fma(v, v, -1.0), 2.0) * 0.0625))));
}
function code(v)
	return Float64(Float64(Float64(sqrt(2.0) / 4.0) * sqrt(Float64(1.0 - Float64(3.0 * Float64(v * v))))) * Float64(1.0 - Float64(v * v)))
end
function code(v)
	return sqrt(Float64(fma(v, Float64(v * -3.0), 1.0) * Float64(2.0 * Float64((fma(v, v, -1.0) ^ 2.0) * 0.0625))))
end
code[v_] := N[(N[(N[(N[Sqrt[2.0], $MachinePrecision] / 4.0), $MachinePrecision] * N[Sqrt[N[(1.0 - N[(3.0 * N[(v * v), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(v * v), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
code[v_] := N[Sqrt[N[(N[(v * N[(v * -3.0), $MachinePrecision] + 1.0), $MachinePrecision] * N[(2.0 * N[(N[Power[N[(v * v + -1.0), $MachinePrecision], 2.0], $MachinePrecision] * 0.0625), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\left(\frac{\sqrt{2}}{4} \cdot \sqrt{1 - 3 \cdot \left(v \cdot v\right)}\right) \cdot \left(1 - v \cdot v\right)
\sqrt{\mathsf{fma}\left(v, v \cdot -3, 1\right) \cdot \left(2 \cdot \left({\left(\mathsf{fma}\left(v, v, -1\right)\right)}^{2} \cdot 0.0625\right)\right)}

Error

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{\mathsf{fma}\left(v, v \cdot -3, 1\right)} \cdot \left(\sqrt{2} \cdot \left(-0.25 \cdot \mathsf{fma}\left(v, v, -1\right)\right)\right)} \]
  3. Applied egg-rr1.0

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

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

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

Reproduce

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