?

Average Accuracy: 99.2% → 99.2%
Time: 11.4s
Precision: binary64
Cost: 20160.00

?

\[\cos^{-1} \left(\frac{1 - 5 \cdot \left(v \cdot v\right)}{v \cdot v - 1}\right) \]
\[{\left({\cos^{-1} \left(\frac{-1 + v \cdot \left(5 \cdot v\right)}{1 - v \cdot v}\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 (* v (* 5.0 v))) (- 1.0 (* v v)))) 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 + (v * (5.0 * v))) / (1.0 - (v * v)))), 3.0), 0.3333333333333333);
}
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
    code = (acos((((-1.0d0) + (v * (5.0d0 * v))) / (1.0d0 - (v * v)))) ** 3.0d0) ** 0.3333333333333333d0
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) {
	return Math.pow(Math.pow(Math.acos(((-1.0 + (v * (5.0 * v))) / (1.0 - (v * v)))), 3.0), 0.3333333333333333);
}
def code(v):
	return math.acos(((1.0 - (5.0 * (v * v))) / ((v * v) - 1.0)))
def code(v):
	return math.pow(math.pow(math.acos(((-1.0 + (v * (5.0 * v))) / (1.0 - (v * v)))), 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 + Float64(v * Float64(5.0 * v))) / Float64(1.0 - Float64(v * v)))) ^ 3.0) ^ 0.3333333333333333
end
function tmp = code(v)
	tmp = acos(((1.0 - (5.0 * (v * v))) / ((v * v) - 1.0)));
end
function tmp = code(v)
	tmp = (acos(((-1.0 + (v * (5.0 * v))) / (1.0 - (v * v)))) ^ 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 * N[(5.0 * v), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(1.0 - N[(v * v), $MachinePrecision]), $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 + v \cdot \left(5 \cdot v\right)}{1 - v \cdot v}\right)}^{3}\right)}^{0.3333333333333333}

Error?

Try it out?

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation?

  1. Initial program 99.2%

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

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

    \[\leadsto {\left({\cos^{-1} \color{blue}{\left(-\frac{\mathsf{fma}\left(v, v \cdot -5, 1\right)}{1 - v \cdot v}\right)}}^{3}\right)}^{0.3333333333333333} \]
  4. Simplified99.2%

    \[\leadsto {\left({\cos^{-1} \color{blue}{\left(\frac{-1 + \left(5 \cdot v\right) \cdot v}{1 - v \cdot v}\right)}}^{3}\right)}^{0.3333333333333333} \]
    Proof

    [Start]99.2

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

    distribute-frac-neg [<=]99.2

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

    fma-udef [=>]99.2

    \[ {\left({\cos^{-1} \left(\frac{-\color{blue}{\left(v \cdot \left(v \cdot -5\right) + 1\right)}}{1 - v \cdot v}\right)}^{3}\right)}^{0.3333333333333333} \]

    associate-*l* [<=]99.2

    \[ {\left({\cos^{-1} \left(\frac{-\left(\color{blue}{\left(v \cdot v\right) \cdot -5} + 1\right)}{1 - v \cdot v}\right)}^{3}\right)}^{0.3333333333333333} \]

    distribute-neg-in [=>]99.2

    \[ {\left({\cos^{-1} \left(\frac{\color{blue}{\left(-\left(v \cdot v\right) \cdot -5\right) + \left(-1\right)}}{1 - v \cdot v}\right)}^{3}\right)}^{0.3333333333333333} \]

    metadata-eval [=>]99.2

    \[ {\left({\cos^{-1} \left(\frac{\left(-\left(v \cdot v\right) \cdot -5\right) + \color{blue}{-1}}{1 - v \cdot v}\right)}^{3}\right)}^{0.3333333333333333} \]

    +-commutative [<=]99.2

    \[ {\left({\cos^{-1} \left(\frac{\color{blue}{-1 + \left(-\left(v \cdot v\right) \cdot -5\right)}}{1 - v \cdot v}\right)}^{3}\right)}^{0.3333333333333333} \]

    *-commutative [=>]99.2

    \[ {\left({\cos^{-1} \left(\frac{-1 + \left(-\color{blue}{-5 \cdot \left(v \cdot v\right)}\right)}{1 - v \cdot v}\right)}^{3}\right)}^{0.3333333333333333} \]

    distribute-lft-neg-in [=>]99.2

    \[ {\left({\cos^{-1} \left(\frac{-1 + \color{blue}{\left(--5\right) \cdot \left(v \cdot v\right)}}{1 - v \cdot v}\right)}^{3}\right)}^{0.3333333333333333} \]

    metadata-eval [=>]99.2

    \[ {\left({\cos^{-1} \left(\frac{-1 + \color{blue}{5} \cdot \left(v \cdot v\right)}{1 - v \cdot v}\right)}^{3}\right)}^{0.3333333333333333} \]

    associate-*r* [=>]99.2

    \[ {\left({\cos^{-1} \left(\frac{-1 + \color{blue}{\left(5 \cdot v\right) \cdot v}}{1 - v \cdot v}\right)}^{3}\right)}^{0.3333333333333333} \]
  5. Final simplification99.2%

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

Alternatives

Alternative 1
Accuracy99.1%
Cost7488.00
\[\cos^{-1} \left(\frac{1 + \left(1 + \left(-1 + \left(v \cdot v\right) \cdot -5\right)\right)}{-1 + v \cdot v}\right) \]
Alternative 2
Accuracy98.6%
Cost7232.00
\[\cos^{-1} \left(\left(1 + v \cdot v\right) \cdot \left(-1 + 5 \cdot \left(v \cdot v\right)\right)\right) \]
Alternative 3
Accuracy99.2%
Cost7232.00
\[\cos^{-1} \left(\frac{1 + \left(v \cdot v\right) \cdot -5}{-1 + v \cdot v}\right) \]
Alternative 4
Accuracy98.1%
Cost6848.00
\[\cos^{-1} \left(-1 + 5 \cdot \left(v \cdot v\right)\right) \]
Alternative 5
Accuracy97.9%
Cost6464.00
\[\cos^{-1} -1 \]

Error

Reproduce?

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