Average Error: 0.5 → 0.5
Time: 18.0s
Precision: binary64
Cost: 32896
\[\cos^{-1} \left(\frac{1 - 5 \cdot \left(v \cdot v\right)}{v \cdot v - 1}\right) \]
\[{\left(\frac{1}{\pi - \cos^{-1} \left(\frac{\mathsf{fma}\left(v, v \cdot -5, 1\right)}{-\mathsf{fma}\left(v, v, -1\right)}\right)}\right)}^{-1} \]
(FPCore (v)
 :precision binary64
 (acos (/ (- 1.0 (* 5.0 (* v v))) (- (* v v) 1.0))))
(FPCore (v)
 :precision binary64
 (pow
  (/ 1.0 (- PI (acos (/ (fma v (* v -5.0) 1.0) (- (fma v v -1.0))))))
  -1.0))
double code(double v) {
	return acos(((1.0 - (5.0 * (v * v))) / ((v * v) - 1.0)));
}
double code(double v) {
	return pow((1.0 / (((double) M_PI) - acos((fma(v, (v * -5.0), 1.0) / -fma(v, v, -1.0))))), -1.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)
	return Float64(1.0 / Float64(pi - acos(Float64(fma(v, Float64(v * -5.0), 1.0) / Float64(-fma(v, v, -1.0)))))) ^ -1.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_] := N[Power[N[(1.0 / N[(Pi - N[ArcCos[N[(N[(v * N[(v * -5.0), $MachinePrecision] + 1.0), $MachinePrecision] / (-N[(v * v + -1.0), $MachinePrecision])), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], -1.0], $MachinePrecision]
\cos^{-1} \left(\frac{1 - 5 \cdot \left(v \cdot v\right)}{v \cdot v - 1}\right)
{\left(\frac{1}{\pi - \cos^{-1} \left(\frac{\mathsf{fma}\left(v, v \cdot -5, 1\right)}{-\mathsf{fma}\left(v, v, -1\right)}\right)}\right)}^{-1}

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-rr62.6

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

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

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

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

Alternatives

Alternative 1
Error0.5
Cost32832
\[{\left(\frac{1}{\pi - \cos^{-1} \left(\frac{\mathsf{fma}\left(v \cdot v, 5, -1\right)}{\mathsf{fma}\left(v, v, -1\right)}\right)}\right)}^{-1} \]
Alternative 2
Error0.5
Cost26368
\[{\left(\frac{1}{\cos^{-1} \left(\frac{\mathsf{fma}\left(v, v \cdot -5, 1\right)}{\mathsf{fma}\left(v, v, -1\right)}\right)}\right)}^{-1} \]
Alternative 3
Error0.5
Cost26304
\[\pi - \cos^{-1} \left(\frac{\mathsf{fma}\left(v \cdot v, -5, 1\right)}{-\mathsf{fma}\left(v, v, -1\right)}\right) \]
Alternative 4
Error0.5
Cost26240
\[\pi - \cos^{-1} \left(\frac{\mathsf{fma}\left(v, v \cdot 5, -1\right)}{\mathsf{fma}\left(v, v, -1\right)}\right) \]
Alternative 5
Error0.5
Cost19968
\[\pi - \cos^{-1} \left(\frac{-1 + \left(v \cdot v\right) \cdot 5}{\mathsf{fma}\left(v, v, -1\right)}\right) \]
Alternative 6
Error0.5
Cost7232
\[\cos^{-1} \left(\frac{1 - \left(v \cdot v\right) \cdot 5}{-1 + v \cdot v}\right) \]
Alternative 7
Error1.3
Cost64
\[\cos^{-1} -1 \]

Error

Reproduce

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