Average Error: 0.5 → 0.5
Time: 23.5s
Precision: binary64
Cost: 90944
\[\cos^{-1} \left(\frac{1 - 5 \cdot \left(v \cdot v\right)}{v \cdot v - 1}\right) \]
\[\begin{array}{l} t_0 := \sqrt[3]{\log \cos^{-1} \left(\frac{\mathsf{fma}\left(v, v \cdot -5, 1\right)}{\mathsf{fma}\left(v, v, -1\right)}\right)}\\ e^{t_0 \cdot {\left({\left(\sqrt[3]{t_0}\right)}^{2}\right)}^{3}} \end{array} \]
(FPCore (v)
 :precision binary64
 (acos (/ (- 1.0 (* 5.0 (* v v))) (- (* v v) 1.0))))
(FPCore (v)
 :precision binary64
 (let* ((t_0 (cbrt (log (acos (/ (fma v (* v -5.0) 1.0) (fma v v -1.0)))))))
   (exp (* t_0 (pow (pow (cbrt t_0) 2.0) 3.0)))))
double code(double v) {
	return acos(((1.0 - (5.0 * (v * v))) / ((v * v) - 1.0)));
}
double code(double v) {
	double t_0 = cbrt(log(acos((fma(v, (v * -5.0), 1.0) / fma(v, v, -1.0)))));
	return exp((t_0 * pow(pow(cbrt(t_0), 2.0), 3.0)));
}
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)
	t_0 = cbrt(log(acos(Float64(fma(v, Float64(v * -5.0), 1.0) / fma(v, v, -1.0)))))
	return exp(Float64(t_0 * ((cbrt(t_0) ^ 2.0) ^ 3.0)))
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_] := Block[{t$95$0 = N[Power[N[Log[N[ArcCos[N[(N[(v * N[(v * -5.0), $MachinePrecision] + 1.0), $MachinePrecision] / N[(v * v + -1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision], 1/3], $MachinePrecision]}, N[Exp[N[(t$95$0 * N[Power[N[Power[N[Power[t$95$0, 1/3], $MachinePrecision], 2.0], $MachinePrecision], 3.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\cos^{-1} \left(\frac{1 - 5 \cdot \left(v \cdot v\right)}{v \cdot v - 1}\right)
\begin{array}{l}
t_0 := \sqrt[3]{\log \cos^{-1} \left(\frac{\mathsf{fma}\left(v, v \cdot -5, 1\right)}{\mathsf{fma}\left(v, v, -1\right)}\right)}\\
e^{t_0 \cdot {\left({\left(\sqrt[3]{t_0}\right)}^{2}\right)}^{3}}
\end{array}

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

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

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

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

Alternatives

Alternative 1
Error0.5
Cost32576
\[e^{\log \cos^{-1} \left(\frac{\mathsf{fma}\left(v \cdot v, -5, 1\right)}{\mathsf{fma}\left(v, v, -1\right)}\right)} \]
Alternative 2
Error0.5
Cost7232
\[\cos^{-1} \left(\frac{1 + -5 \cdot \left(v \cdot v\right)}{-1 + v \cdot v}\right) \]

Error

Reproduce

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