?

Average Error: 0.6 → 0.6
Time: 27.1s
Precision: binary64
Cost: 51392

?

\[\cos^{-1} \left(\frac{1 - 5 \cdot \left(v \cdot v\right)}{v \cdot v - 1}\right) \]
\[\begin{array}{l} t_0 := \cos^{-1} \left(\frac{1 - 5 \cdot \left(v \cdot v\right)}{v \cdot v + -1}\right)\\ t_1 := \frac{1}{t_0}\\ t_1 \cdot \left(\left(t_1 \cdot \left(\left(\left(t_0 \cdot t_1\right) \cdot t_0\right) \cdot t_0\right)\right) \cdot t_0\right) \end{array} \]
(FPCore (v)
 :precision binary64
 (acos (/ (- 1.0 (* 5.0 (* v v))) (- (* v v) 1.0))))
(FPCore (v)
 :precision binary64
 (let* ((t_0 (acos (/ (- 1.0 (* 5.0 (* v v))) (+ (* v v) -1.0))))
        (t_1 (/ 1.0 t_0)))
   (* t_1 (* (* t_1 (* (* (* t_0 t_1) t_0) t_0)) t_0))))
double code(double v) {
	return acos(((1.0 - (5.0 * (v * v))) / ((v * v) - 1.0)));
}
double code(double v) {
	double t_0 = acos(((1.0 - (5.0 * (v * v))) / ((v * v) + -1.0)));
	double t_1 = 1.0 / t_0;
	return t_1 * ((t_1 * (((t_0 * t_1) * t_0) * t_0)) * t_0);
}
real(8) function code(v)
    real(8), intent (in) :: v
    code = acos(((1.0d0 - (5.0d0 * (v * v))) / ((v * v) - 1.0d0)))
end function
real(8) function code(v)
    real(8), intent (in) :: v
    real(8) :: t_0
    real(8) :: t_1
    t_0 = acos(((1.0d0 - (5.0d0 * (v * v))) / ((v * v) + (-1.0d0))))
    t_1 = 1.0d0 / t_0
    code = t_1 * ((t_1 * (((t_0 * t_1) * t_0) * t_0)) * t_0)
end function
public static double code(double v) {
	return Math.acos(((1.0 - (5.0 * (v * v))) / ((v * v) - 1.0)));
}
public static double code(double v) {
	double t_0 = Math.acos(((1.0 - (5.0 * (v * v))) / ((v * v) + -1.0)));
	double t_1 = 1.0 / t_0;
	return t_1 * ((t_1 * (((t_0 * t_1) * t_0) * t_0)) * t_0);
}
def code(v):
	return math.acos(((1.0 - (5.0 * (v * v))) / ((v * v) - 1.0)))
def code(v):
	t_0 = math.acos(((1.0 - (5.0 * (v * v))) / ((v * v) + -1.0)))
	t_1 = 1.0 / t_0
	return t_1 * ((t_1 * (((t_0 * t_1) * t_0) * t_0)) * t_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 = acos(Float64(Float64(1.0 - Float64(5.0 * Float64(v * v))) / Float64(Float64(v * v) + -1.0)))
	t_1 = Float64(1.0 / t_0)
	return Float64(t_1 * Float64(Float64(t_1 * Float64(Float64(Float64(t_0 * t_1) * t_0) * t_0)) * t_0))
end
function tmp = code(v)
	tmp = acos(((1.0 - (5.0 * (v * v))) / ((v * v) - 1.0)));
end
function tmp = code(v)
	t_0 = acos(((1.0 - (5.0 * (v * v))) / ((v * v) + -1.0)));
	t_1 = 1.0 / t_0;
	tmp = t_1 * ((t_1 * (((t_0 * t_1) * t_0) * t_0)) * t_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[ArcCos[N[(N[(1.0 - N[(5.0 * N[(v * v), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(N[(v * v), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(1.0 / t$95$0), $MachinePrecision]}, N[(t$95$1 * N[(N[(t$95$1 * N[(N[(N[(t$95$0 * t$95$1), $MachinePrecision] * t$95$0), $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision]]]
\cos^{-1} \left(\frac{1 - 5 \cdot \left(v \cdot v\right)}{v \cdot v - 1}\right)
\begin{array}{l}
t_0 := \cos^{-1} \left(\frac{1 - 5 \cdot \left(v \cdot v\right)}{v \cdot v + -1}\right)\\
t_1 := \frac{1}{t_0}\\
t_1 \cdot \left(\left(t_1 \cdot \left(\left(\left(t_0 \cdot t_1\right) \cdot t_0\right) \cdot t_0\right)\right) \cdot t_0\right)
\end{array}

Error?

Try it out?

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation?

  1. Initial program 0.6

    \[\cos^{-1} \left(\frac{1 - 5 \cdot \left(v \cdot v\right)}{v \cdot v - 1}\right) \]
  2. Applied egg-rr0.6

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

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

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

    \[\leadsto \frac{1}{\cos^{-1} \left(\frac{1 - 5 \cdot \left(v \cdot v\right)}{v \cdot v + -1}\right)} \cdot \left(\left(\frac{1}{\cos^{-1} \left(\frac{1 - 5 \cdot \left(v \cdot v\right)}{v \cdot v + -1}\right)} \cdot \left(\left(\left(\cos^{-1} \left(\frac{1 - 5 \cdot \left(v \cdot v\right)}{v \cdot v + -1}\right) \cdot \frac{1}{\cos^{-1} \left(\frac{1 - 5 \cdot \left(v \cdot v\right)}{v \cdot v + -1}\right)}\right) \cdot \cos^{-1} \left(\frac{1 - 5 \cdot \left(v \cdot v\right)}{v \cdot v + -1}\right)\right) \cdot \cos^{-1} \left(\frac{1 - 5 \cdot \left(v \cdot v\right)}{v \cdot v + -1}\right)\right)\right) \cdot \cos^{-1} \left(\frac{1 - 5 \cdot \left(v \cdot v\right)}{v \cdot v + -1}\right)\right) \]

Alternatives

Alternative 1
Error0.6
Cost36672
\[\begin{array}{l} t_0 := \cos^{-1} \left(\frac{1 - 5 \cdot \left(v \cdot v\right)}{v \cdot v + -1}\right)\\ \left(t_0 \cdot \frac{1}{\frac{1}{t_0} \cdot \left(t_0 \cdot t_0\right)}\right) \cdot t_0 \end{array} \]
Alternative 2
Error0.6
Cost36672
\[\begin{array}{l} t_0 := \cos^{-1} \left(\frac{1 - 5 \cdot \left(v \cdot v\right)}{v \cdot v + -1}\right)\\ t_1 := \frac{1}{t_0}\\ t_1 \cdot \left(\left(\left(t_0 \cdot t_1\right) \cdot t_0\right) \cdot t_0\right) \end{array} \]
Alternative 3
Error0.6
Cost21952
\[\begin{array}{l} t_0 := \cos^{-1} \left(\frac{1 - 5 \cdot \left(v \cdot v\right)}{v \cdot v + -1}\right)\\ \left(t_0 \cdot \frac{1}{t_0}\right) \cdot t_0 \end{array} \]
Alternative 4
Error0.6
Cost7232
\[\cos^{-1} \left(\frac{1 - 5 \cdot \left(v \cdot v\right)}{v \cdot v - 1}\right) \]
Alternative 5
Error1.3
Cost6464
\[\cos^{-1} -1 \]

Error

Reproduce?

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