?

Average Error: 14.7 → 14.7
Time: 44.3s
Precision: binary64
Cost: 33472

?

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

Error?

Try it out?

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original14.7
Target0.4
Herbie14.7
\[\tan^{-1} \left(\frac{1}{1 + N \cdot \left(N + 1\right)}\right) \]

Derivation?

  1. Initial program 14.7

    \[\tan^{-1} \left(N + 1\right) - \tan^{-1} N \]
  2. Applied egg-rr14.7

    \[\leadsto \color{blue}{\left(\left(\tan^{-1} N + \frac{\tan^{-1} \left(N + 1\right)}{2}\right) - \left(\frac{\tan^{-1} \left(N + 1\right)}{-2} + \tan^{-1} N\right)\right)} - \tan^{-1} N \]
  3. Applied egg-rr14.8

    \[\leadsto \color{blue}{\left(\frac{\tan^{-1} \left(N + 1\right)}{4} + \frac{\tan^{-1} N}{2}\right) + \left(\left(\frac{\tan^{-1} \left(N + 1\right)}{4} + \frac{\tan^{-1} N}{2}\right) - \left(\tan^{-1} N \cdot 2 + \tan^{-1} \left(N + 1\right) \cdot -0.5\right)\right)} \]
  4. Simplified14.7

    \[\leadsto \color{blue}{\frac{\tan^{-1} \left(N + 1\right)}{4} + \left(\frac{\tan^{-1} N}{2} + \left(\left(\frac{\tan^{-1} \left(N + 1\right)}{4} + \frac{\tan^{-1} N}{2}\right) - \left(\tan^{-1} \left(N + 1\right) \cdot -0.5 + \tan^{-1} N \cdot 2\right)\right)\right)} \]
    Proof

    [Start]14.8

    \[ \left(\frac{\tan^{-1} \left(N + 1\right)}{4} + \frac{\tan^{-1} N}{2}\right) + \left(\left(\frac{\tan^{-1} \left(N + 1\right)}{4} + \frac{\tan^{-1} N}{2}\right) - \left(\tan^{-1} N \cdot 2 + \tan^{-1} \left(N + 1\right) \cdot -0.5\right)\right) \]

    rational_best-simplify-3 [=>]14.8

    \[ \color{blue}{\left(\left(\frac{\tan^{-1} \left(N + 1\right)}{4} + \frac{\tan^{-1} N}{2}\right) - \left(\tan^{-1} N \cdot 2 + \tan^{-1} \left(N + 1\right) \cdot -0.5\right)\right) + \left(\frac{\tan^{-1} \left(N + 1\right)}{4} + \frac{\tan^{-1} N}{2}\right)} \]

    rational_best-simplify-3 [=>]14.8

    \[ \left(\left(\frac{\tan^{-1} \left(N + 1\right)}{4} + \frac{\tan^{-1} N}{2}\right) - \left(\tan^{-1} N \cdot 2 + \tan^{-1} \left(N + 1\right) \cdot -0.5\right)\right) + \color{blue}{\left(\frac{\tan^{-1} N}{2} + \frac{\tan^{-1} \left(N + 1\right)}{4}\right)} \]

    rational_best-simplify-47 [=>]14.7

    \[ \color{blue}{\frac{\tan^{-1} \left(N + 1\right)}{4} + \left(\frac{\tan^{-1} N}{2} + \left(\left(\frac{\tan^{-1} \left(N + 1\right)}{4} + \frac{\tan^{-1} N}{2}\right) - \left(\tan^{-1} N \cdot 2 + \tan^{-1} \left(N + 1\right) \cdot -0.5\right)\right)\right)} \]

    rational_best-simplify-3 [=>]14.7

    \[ \frac{\tan^{-1} \left(N + 1\right)}{4} + \left(\frac{\tan^{-1} N}{2} + \left(\left(\frac{\tan^{-1} \left(N + 1\right)}{4} + \frac{\tan^{-1} N}{2}\right) - \color{blue}{\left(\tan^{-1} \left(N + 1\right) \cdot -0.5 + \tan^{-1} N \cdot 2\right)}\right)\right) \]
  5. Applied egg-rr14.7

    \[\leadsto \color{blue}{\frac{\tan^{-1} \left(N + 1\right)}{8} - \left(\frac{\tan^{-1} N}{-2} - \left(\frac{\tan^{-1} \left(N + 1\right)}{8} - \left(\tan^{-1} N \cdot 1.5 - \left(0 - \tan^{-1} \left(N + 1\right) \cdot -0.75\right)\right)\right)\right)} \]
  6. Simplified14.7

    \[\leadsto \color{blue}{\frac{\tan^{-1} \left(N + 1\right)}{8} - \left(\left(\tan^{-1} \left(N + 1\right) \cdot -0.75 + \tan^{-1} N \cdot 1.5\right) - \left(\frac{\tan^{-1} \left(N + 1\right)}{8} - \frac{\tan^{-1} N}{-2}\right)\right)} \]
    Proof

    [Start]14.7

    \[ \frac{\tan^{-1} \left(N + 1\right)}{8} - \left(\frac{\tan^{-1} N}{-2} - \left(\frac{\tan^{-1} \left(N + 1\right)}{8} - \left(\tan^{-1} N \cdot 1.5 - \left(0 - \tan^{-1} \left(N + 1\right) \cdot -0.75\right)\right)\right)\right) \]

    rational_best-simplify-51 [=>]14.7

    \[ \frac{\tan^{-1} \left(N + 1\right)}{8} - \color{blue}{\left(\left(\tan^{-1} N \cdot 1.5 - \left(0 - \tan^{-1} \left(N + 1\right) \cdot -0.75\right)\right) - \left(\frac{\tan^{-1} \left(N + 1\right)}{8} - \frac{\tan^{-1} N}{-2}\right)\right)} \]

    rational_best-simplify-15 [=>]14.7

    \[ \frac{\tan^{-1} \left(N + 1\right)}{8} - \left(\left(\tan^{-1} N \cdot 1.5 - \color{blue}{\left(-\tan^{-1} \left(N + 1\right) \cdot -0.75\right)}\right) - \left(\frac{\tan^{-1} \left(N + 1\right)}{8} - \frac{\tan^{-1} N}{-2}\right)\right) \]

    rational_best-simplify-59 [<=]14.7

    \[ \frac{\tan^{-1} \left(N + 1\right)}{8} - \left(\color{blue}{\left(\tan^{-1} \left(N + 1\right) \cdot -0.75 + \tan^{-1} N \cdot 1.5\right)} - \left(\frac{\tan^{-1} \left(N + 1\right)}{8} - \frac{\tan^{-1} N}{-2}\right)\right) \]
  7. Applied egg-rr14.7

    \[\leadsto \frac{\tan^{-1} \left(N + 1\right)}{8} - \color{blue}{\left(\frac{\tan^{-1} N}{-4} + \left(\left(\tan^{-1} N \cdot 1.5 + \tan^{-1} \left(N + 1\right) \cdot -0.875\right) + \frac{\tan^{-1} N}{-4}\right)\right)} \]
  8. Final simplification14.7

    \[\leadsto \frac{\tan^{-1} \left(N + 1\right)}{8} - \left(\frac{\tan^{-1} N}{-4} + \left(\left(\tan^{-1} N \cdot 1.5 + \tan^{-1} \left(N + 1\right) \cdot -0.875\right) + \frac{\tan^{-1} N}{-4}\right)\right) \]

Alternatives

Alternative 1
Error14.7
Cost33216
\[\begin{array}{l} t_0 := \tan^{-1} \left(N + 1\right)\\ \left(t_0 + \frac{\tan^{-1} N}{-2}\right) + \left(t_0 - \left(t_0 + \frac{\tan^{-1} N}{2}\right)\right) \end{array} \]
Alternative 2
Error14.7
Cost26688
\[\frac{\tan^{-1} N}{8} + \left(\tan^{-1} \left(N + 1\right) - \left(\frac{\tan^{-1} N \cdot 3}{-8} + \tan^{-1} N \cdot 1.5\right)\right) \]
Alternative 3
Error14.7
Cost19904
\[\left(\tan^{-1} N \cdot -1.5 + \tan^{-1} \left(N + 1\right)\right) + \tan^{-1} N \cdot 0.5 \]
Alternative 4
Error14.7
Cost19904
\[\left(\tan^{-1} \left(N + 1\right) + \tan^{-1} N \cdot -0.875\right) - \tan^{-1} N \cdot 0.125 \]
Alternative 5
Error14.7
Cost13120
\[\tan^{-1} \left(N + 1\right) - \tan^{-1} N \]

Error

Reproduce?

herbie shell --seed 2023099 
(FPCore (N)
  :name "2atan (example 3.5)"
  :precision binary64

  :herbie-target
  (atan (/ 1.0 (+ 1.0 (* N (+ N 1.0)))))

  (- (atan (+ N 1.0)) (atan N)))