Average Error: 0.0 → 0.0
Time: 1.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) \]
\[e^{\mathsf{fma}\left(0.5, \log \left(\mathsf{fma}\left(v, v \cdot -3, 1\right) \cdot 0.125\right), \mathsf{log1p}\left(v \cdot \left(-v\right)\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
 (exp (fma 0.5 (log (* (fma v (* v -3.0) 1.0) 0.125)) (log1p (* v (- v))))))
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 exp(fma(0.5, log((fma(v, (v * -3.0), 1.0) * 0.125)), log1p((v * -v))));
}
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 exp(fma(0.5, log(Float64(fma(v, Float64(v * -3.0), 1.0) * 0.125)), log1p(Float64(v * Float64(-v)))))
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[Exp[N[(0.5 * N[Log[N[(N[(v * N[(v * -3.0), $MachinePrecision] + 1.0), $MachinePrecision] * 0.125), $MachinePrecision]], $MachinePrecision] + N[Log[1 + N[(v * (-v)), $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)
e^{\mathsf{fma}\left(0.5, \log \left(\mathsf{fma}\left(v, v \cdot -3, 1\right) \cdot 0.125\right), \mathsf{log1p}\left(v \cdot \left(-v\right)\right)\right)}

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. Applied egg-rr0.0

    \[\leadsto \color{blue}{\sqrt{\left(1 + \left(v \cdot v\right) \cdot -3\right) \cdot 0.125}} \cdot \left(1 - v \cdot v\right) \]
  3. Applied egg-rr0.0

    \[\leadsto \color{blue}{e^{\mathsf{fma}\left(0.5, \log \left(\mathsf{fma}\left(v, v \cdot -3, 1\right) \cdot 0.125\right), \mathsf{log1p}\left(v \cdot \left(-v\right)\right)\right)}} \]
  4. Final simplification0.0

    \[\leadsto e^{\mathsf{fma}\left(0.5, \log \left(\mathsf{fma}\left(v, v \cdot -3, 1\right) \cdot 0.125\right), \mathsf{log1p}\left(v \cdot \left(-v\right)\right)\right)} \]

Reproduce

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