?

Average Error: 0.0 → 0.0
Time: 3.7s
Precision: binary64
Cost: 16576

?

\[2 \cdot \tan^{-1} \left(\sqrt{\frac{1 - x}{1 + x}}\right) \]
\[\begin{array}{l} t_0 := \frac{1 - x}{1 + x}\\ t_1 := t_0 \cdot t_0\\ 2 \cdot \tan^{-1} \left(\sqrt{\left(t_1 \cdot t_1\right) \cdot \frac{\frac{1}{t_0}}{t_1}}\right) \end{array} \]
(FPCore (x) :precision binary64 (* 2.0 (atan (sqrt (/ (- 1.0 x) (+ 1.0 x))))))
(FPCore (x)
 :precision binary64
 (let* ((t_0 (/ (- 1.0 x) (+ 1.0 x))) (t_1 (* t_0 t_0)))
   (* 2.0 (atan (sqrt (* (* t_1 t_1) (/ (/ 1.0 t_0) t_1)))))))
double code(double x) {
	return 2.0 * atan(sqrt(((1.0 - x) / (1.0 + x))));
}
double code(double x) {
	double t_0 = (1.0 - x) / (1.0 + x);
	double t_1 = t_0 * t_0;
	return 2.0 * atan(sqrt(((t_1 * t_1) * ((1.0 / t_0) / t_1))));
}
real(8) function code(x)
    real(8), intent (in) :: x
    code = 2.0d0 * atan(sqrt(((1.0d0 - x) / (1.0d0 + x))))
end function
real(8) function code(x)
    real(8), intent (in) :: x
    real(8) :: t_0
    real(8) :: t_1
    t_0 = (1.0d0 - x) / (1.0d0 + x)
    t_1 = t_0 * t_0
    code = 2.0d0 * atan(sqrt(((t_1 * t_1) * ((1.0d0 / t_0) / t_1))))
end function
public static double code(double x) {
	return 2.0 * Math.atan(Math.sqrt(((1.0 - x) / (1.0 + x))));
}
public static double code(double x) {
	double t_0 = (1.0 - x) / (1.0 + x);
	double t_1 = t_0 * t_0;
	return 2.0 * Math.atan(Math.sqrt(((t_1 * t_1) * ((1.0 / t_0) / t_1))));
}
def code(x):
	return 2.0 * math.atan(math.sqrt(((1.0 - x) / (1.0 + x))))
def code(x):
	t_0 = (1.0 - x) / (1.0 + x)
	t_1 = t_0 * t_0
	return 2.0 * math.atan(math.sqrt(((t_1 * t_1) * ((1.0 / t_0) / t_1))))
function code(x)
	return Float64(2.0 * atan(sqrt(Float64(Float64(1.0 - x) / Float64(1.0 + x)))))
end
function code(x)
	t_0 = Float64(Float64(1.0 - x) / Float64(1.0 + x))
	t_1 = Float64(t_0 * t_0)
	return Float64(2.0 * atan(sqrt(Float64(Float64(t_1 * t_1) * Float64(Float64(1.0 / t_0) / t_1)))))
end
function tmp = code(x)
	tmp = 2.0 * atan(sqrt(((1.0 - x) / (1.0 + x))));
end
function tmp = code(x)
	t_0 = (1.0 - x) / (1.0 + x);
	t_1 = t_0 * t_0;
	tmp = 2.0 * atan(sqrt(((t_1 * t_1) * ((1.0 / t_0) / t_1))));
end
code[x_] := N[(2.0 * N[ArcTan[N[Sqrt[N[(N[(1.0 - x), $MachinePrecision] / N[(1.0 + x), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
code[x_] := Block[{t$95$0 = N[(N[(1.0 - x), $MachinePrecision] / N[(1.0 + x), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(t$95$0 * t$95$0), $MachinePrecision]}, N[(2.0 * N[ArcTan[N[Sqrt[N[(N[(t$95$1 * t$95$1), $MachinePrecision] * N[(N[(1.0 / t$95$0), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]
2 \cdot \tan^{-1} \left(\sqrt{\frac{1 - x}{1 + x}}\right)
\begin{array}{l}
t_0 := \frac{1 - x}{1 + x}\\
t_1 := t_0 \cdot t_0\\
2 \cdot \tan^{-1} \left(\sqrt{\left(t_1 \cdot t_1\right) \cdot \frac{\frac{1}{t_0}}{t_1}}\right)
\end{array}

Error?

Try it out?

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation?

  1. Initial program 0.0

    \[2 \cdot \tan^{-1} \left(\sqrt{\frac{1 - x}{1 + x}}\right) \]
  2. Applied egg-rr0.0

    \[\leadsto 2 \cdot \tan^{-1} \left(\sqrt{\color{blue}{\left(\left(\frac{1 - x}{1 + x} \cdot \frac{1 - x}{1 + x}\right) \cdot \left(\frac{1 - x}{1 + x} \cdot \frac{1 - x}{1 + x}\right)\right) \cdot \frac{\frac{1}{\frac{1 - x}{1 + x}}}{\frac{1 - x}{1 + x} \cdot \frac{1 - x}{1 + x}}}}\right) \]
  3. Final simplification0.0

    \[\leadsto 2 \cdot \tan^{-1} \left(\sqrt{\left(\left(\frac{1 - x}{1 + x} \cdot \frac{1 - x}{1 + x}\right) \cdot \left(\frac{1 - x}{1 + x} \cdot \frac{1 - x}{1 + x}\right)\right) \cdot \frac{\frac{1}{\frac{1 - x}{1 + x}}}{\frac{1 - x}{1 + x} \cdot \frac{1 - x}{1 + x}}}\right) \]

Alternatives

Alternative 1
Error0.0
Cost13376
\[2 \cdot \tan^{-1} \left(\sqrt{\frac{1 - x}{1 + x}}\right) \]
Alternative 2
Error0.7
Cost6720
\[2 \cdot \tan^{-1} \left(1 - x\right) \]

Error

Reproduce?

herbie shell --seed 2023077 
(FPCore (x)
  :name "arccos"
  :precision binary64
  (* 2.0 (atan (sqrt (/ (- 1.0 x) (+ 1.0 x))))))