Alternative 1 | |
---|---|
Error | 11.9 |
Cost | 45376 |
\[\begin{array}{l}
t_0 := \sqrt{2 \cdot x}\\
{\left({\left(e^{\log \left(t_0 - \tan^{-1} t_0\right)}\right)}^{3}\right)}^{0.3333333333333333}
\end{array}
\]
(FPCore (x) :precision binary64 (- (tan (atan (sqrt (* 2.0 x)))) (atan (sqrt (* 2.0 x)))))
(FPCore (x) :precision binary64 (let* ((t_0 (sqrt (* 2.0 x))) (t_1 (atan t_0))) (pow (/ (- (* 2.0 x) (pow t_1 2.0)) (/ (+ t_0 t_1) (pow (- t_0 t_1) 2.0))) 0.3333333333333333)))
double code(double x) { return tan(atan(sqrt((2.0 * x)))) - atan(sqrt((2.0 * x))); }
double code(double x) { double t_0 = sqrt((2.0 * x)); double t_1 = atan(t_0); return pow((((2.0 * x) - pow(t_1, 2.0)) / ((t_0 + t_1) / pow((t_0 - t_1), 2.0))), 0.3333333333333333); }
real(8) function code(x) real(8), intent (in) :: x code = tan(atan(sqrt((2.0d0 * x)))) - atan(sqrt((2.0d0 * x))) end function
real(8) function code(x) real(8), intent (in) :: x real(8) :: t_0 real(8) :: t_1 t_0 = sqrt((2.0d0 * x)) t_1 = atan(t_0) code = (((2.0d0 * x) - (t_1 ** 2.0d0)) / ((t_0 + t_1) / ((t_0 - t_1) ** 2.0d0))) ** 0.3333333333333333d0 end function
public static double code(double x) { return Math.tan(Math.atan(Math.sqrt((2.0 * x)))) - Math.atan(Math.sqrt((2.0 * x))); }
public static double code(double x) { double t_0 = Math.sqrt((2.0 * x)); double t_1 = Math.atan(t_0); return Math.pow((((2.0 * x) - Math.pow(t_1, 2.0)) / ((t_0 + t_1) / Math.pow((t_0 - t_1), 2.0))), 0.3333333333333333); }
def code(x): return math.tan(math.atan(math.sqrt((2.0 * x)))) - math.atan(math.sqrt((2.0 * x)))
def code(x): t_0 = math.sqrt((2.0 * x)) t_1 = math.atan(t_0) return math.pow((((2.0 * x) - math.pow(t_1, 2.0)) / ((t_0 + t_1) / math.pow((t_0 - t_1), 2.0))), 0.3333333333333333)
function code(x) return Float64(tan(atan(sqrt(Float64(2.0 * x)))) - atan(sqrt(Float64(2.0 * x)))) end
function code(x) t_0 = sqrt(Float64(2.0 * x)) t_1 = atan(t_0) return Float64(Float64(Float64(2.0 * x) - (t_1 ^ 2.0)) / Float64(Float64(t_0 + t_1) / (Float64(t_0 - t_1) ^ 2.0))) ^ 0.3333333333333333 end
function tmp = code(x) tmp = tan(atan(sqrt((2.0 * x)))) - atan(sqrt((2.0 * x))); end
function tmp = code(x) t_0 = sqrt((2.0 * x)); t_1 = atan(t_0); tmp = (((2.0 * x) - (t_1 ^ 2.0)) / ((t_0 + t_1) / ((t_0 - t_1) ^ 2.0))) ^ 0.3333333333333333; end
code[x_] := N[(N[Tan[N[ArcTan[N[Sqrt[N[(2.0 * x), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]], $MachinePrecision] - N[ArcTan[N[Sqrt[N[(2.0 * x), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
code[x_] := Block[{t$95$0 = N[Sqrt[N[(2.0 * x), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[ArcTan[t$95$0], $MachinePrecision]}, N[Power[N[(N[(N[(2.0 * x), $MachinePrecision] - N[Power[t$95$1, 2.0], $MachinePrecision]), $MachinePrecision] / N[(N[(t$95$0 + t$95$1), $MachinePrecision] / N[Power[N[(t$95$0 - t$95$1), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 0.3333333333333333], $MachinePrecision]]]
\tan \tan^{-1} \left(\sqrt{2 \cdot x}\right) - \tan^{-1} \left(\sqrt{2 \cdot x}\right)
\begin{array}{l} t_0 := \sqrt{2 \cdot x}\\ t_1 := \tan^{-1} t_0\\ {\left(\frac{2 \cdot x - {t_1}^{2}}{\frac{t_0 + t_1}{{\left(t_0 - t_1\right)}^{2}}}\right)}^{0.3333333333333333} \end{array}
Results
Initial program 12.0
Applied egg-rr11.9
Applied egg-rr11.9
Final simplification11.9
Alternative 1 | |
---|---|
Error | 11.9 |
Cost | 45376 |
Alternative 2 | |
---|---|
Error | 11.9 |
Cost | 32576 |
Alternative 3 | |
---|---|
Error | 11.9 |
Cost | 19648 |
Alternative 4 | |
---|---|
Error | 55.1 |
Cost | 19520 |
Alternative 5 | |
---|---|
Error | 63.0 |
Cost | 13056 |
herbie shell --seed 1
(FPCore (x)
:name "tan(atan(sqrt(2*x)))-atan(sqrt(2*x))"
:precision binary64
:pre (and (<= 1e-9 x) (<= x 10.0))
(- (tan (atan (sqrt (* 2.0 x)))) (atan (sqrt (* 2.0 x)))))