Average Error: 0.5 → 0.6
Time: 7.7s
Precision: binary64
\[\cos^{-1} \left(\frac{1 - 5 \cdot \left(v \cdot v\right)}{v \cdot v - 1}\right) \]
\[{\left({\cos^{-1} \left(\frac{1}{\mathsf{fma}\left(v, v, -1\right)} \cdot \mathsf{fma}\left(v, v \cdot -5, 1\right)\right)}^{3}\right)}^{0.3333333333333333} \]
(FPCore (v)
 :precision binary64
 (acos (/ (- 1.0 (* 5.0 (* v v))) (- (* v v) 1.0))))
(FPCore (v)
 :precision binary64
 (pow
  (pow (acos (* (/ 1.0 (fma v v -1.0)) (fma v (* v -5.0) 1.0))) 3.0)
  0.3333333333333333))
double code(double v) {
	return acos(((1.0 - (5.0 * (v * v))) / ((v * v) - 1.0)));
}
double code(double v) {
	return pow(pow(acos(((1.0 / fma(v, v, -1.0)) * fma(v, (v * -5.0), 1.0))), 3.0), 0.3333333333333333);
}
function code(v)
	return acos(Float64(Float64(1.0 - Float64(5.0 * Float64(v * v))) / Float64(Float64(v * v) - 1.0)))
end
function code(v)
	return (acos(Float64(Float64(1.0 / fma(v, v, -1.0)) * fma(v, Float64(v * -5.0), 1.0))) ^ 3.0) ^ 0.3333333333333333
end
code[v_] := N[ArcCos[N[(N[(1.0 - N[(5.0 * N[(v * v), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(N[(v * v), $MachinePrecision] - 1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
code[v_] := N[Power[N[Power[N[ArcCos[N[(N[(1.0 / N[(v * v + -1.0), $MachinePrecision]), $MachinePrecision] * N[(v * N[(v * -5.0), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], 3.0], $MachinePrecision], 0.3333333333333333], $MachinePrecision]
\cos^{-1} \left(\frac{1 - 5 \cdot \left(v \cdot v\right)}{v \cdot v - 1}\right)
{\left({\cos^{-1} \left(\frac{1}{\mathsf{fma}\left(v, v, -1\right)} \cdot \mathsf{fma}\left(v, v \cdot -5, 1\right)\right)}^{3}\right)}^{0.3333333333333333}

Error

Derivation

  1. Initial program 0.5

    \[\cos^{-1} \left(\frac{1 - 5 \cdot \left(v \cdot v\right)}{v \cdot v - 1}\right) \]
  2. Simplified0.5

    \[\leadsto \color{blue}{\cos^{-1} \left(\frac{\mathsf{fma}\left(v, v \cdot -5, 1\right)}{\mathsf{fma}\left(v, v, -1\right)}\right)} \]
  3. Applied egg-rr0.5

    \[\leadsto \color{blue}{{\left({\cos^{-1} \left(\frac{\mathsf{fma}\left(v, v \cdot -5, 1\right)}{\mathsf{fma}\left(v, v, -1\right)}\right)}^{3}\right)}^{0.3333333333333333}} \]
  4. Applied egg-rr0.6

    \[\leadsto {\left({\cos^{-1} \color{blue}{\left(\frac{1}{\mathsf{fma}\left(v, v, -1\right)} \cdot \mathsf{fma}\left(v, v \cdot -5, 1\right)\right)}}^{3}\right)}^{0.3333333333333333} \]
  5. Final simplification0.6

    \[\leadsto {\left({\cos^{-1} \left(\frac{1}{\mathsf{fma}\left(v, v, -1\right)} \cdot \mathsf{fma}\left(v, v \cdot -5, 1\right)\right)}^{3}\right)}^{0.3333333333333333} \]

Reproduce

herbie shell --seed 2022192 
(FPCore (v)
  :name "Falkner and Boettcher, Appendix B, 1"
  :precision binary64
  (acos (/ (- 1.0 (* 5.0 (* v v))) (- (* v v) 1.0))))