Average Error: 14.3 → 0.1
Time: 53.5s
Precision: 64
Internal Precision: 128
\[\frac{1}{x + 1} - \frac{1}{x - 1}\]
\[\frac{\frac{-2}{x + 1}}{x - 1}\]

Error

Bits error versus x

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 14.3

    \[\frac{1}{x + 1} - \frac{1}{x - 1}\]
  2. Using strategy rm
  3. Applied frac-sub13.6

    \[\leadsto \color{blue}{\frac{1 \cdot \left(x - 1\right) - \left(x + 1\right) \cdot 1}{\left(x + 1\right) \cdot \left(x - 1\right)}}\]
  4. Simplified0.4

    \[\leadsto \frac{\color{blue}{-2}}{\left(x + 1\right) \cdot \left(x - 1\right)}\]
  5. Using strategy rm
  6. Applied associate-/r*0.1

    \[\leadsto \color{blue}{\frac{\frac{-2}{x + 1}}{x - 1}}\]
  7. Final simplification0.1

    \[\leadsto \frac{\frac{-2}{x + 1}}{x - 1}\]

Reproduce

herbie shell --seed 2019022 
(FPCore (x)
  :name "Asymptote A"
  (- (/ 1 (+ x 1)) (/ 1 (- x 1))))

Details

Time bar (total: 53.2s)Debug log

sample66.0ms

Algorithm
intervals
Results
22.0ms55×body640valid
14.0ms135×body80valid
14.0ms45×body320valid
4.0ms21×body160valid

simplify9.0ms

Counts
1 → 1
Calls
1 calls:
Slowest
9.0ms
(- (/ 1 (+ x 1)) (/ 1 (- x 1)))

prune4.0ms

Pruning

1 alts after pruning (1 fresh and 0 done)

Merged error: 15.0b

localize12.0ms

Local error

Found 3 expressions with local error:

4.1b
(- (/ 1 (+ x 1)) (/ 1 (- x 1)))
0.0b
(/ 1 (- x 1))
0.0b
(/ 1 (+ x 1))

rewrite11.0ms

Algorithm
rewrite-expression-head
Rules
*-un-lft-identity
add-sqr-sqrt
div-inv
associate-/r/
associate-/r*
add-log-exp
distribute-lft-out--
add-cube-cbrt
add-exp-log
pow1
flip--
add-cbrt-cube
inv-pow
pow-flip
flip-+
flip3--
frac-2neg
clear-num
rec-exp
difference-of-squares
frac-sub
diff-log
flip3-+
sub-neg
Counts
3 → 55
Calls
3 calls:
Slowest
6.0ms
(- (/ 1 (+ x 1)) (/ 1 (- x 1)))
2.0ms
(/ 1 (- x 1))
2.0ms
(/ 1 (+ x 1))

series75.0ms

Counts
3 → 9
Calls
3 calls:
Slowest
54.0ms
(- (/ 1 (+ x 1)) (/ 1 (- x 1)))
11.0ms
(/ 1 (- x 1))
9.0ms
(/ 1 (+ x 1))

simplify1.6s

Counts
32 → 64
Calls
32 calls:
Slowest
461.0ms
(- (+ (* 2 (/ 1 (pow x 4))) (+ (* 2 (/ 1 (pow x 6))) (* 2 (/ 1 (pow x 2))))))
389.0ms
(- (+ (* 2 (/ 1 (pow x 4))) (+ (* 2 (/ 1 (pow x 6))) (* 2 (/ 1 (pow x 2))))))
153.0ms
(- (* 1 (- x 1)) (* (+ x 1) 1))
79.0ms
(- (+ x (+ (pow x 2) 1)))
65.0ms
(- (- x 1) (+ x 1))

prune510.0ms

Pruning

2 alts after pruning (1 fresh and 1 done)

Merged error: 0.1b

localize10.0ms

Local error

Found 2 expressions with local error:

0.1b
(/ -2 (* (+ x 1) (- x 1)))
0.0b
(* (+ x 1) (- x 1))

rewrite12.0ms

Algorithm
rewrite-expression-head
Rules
associate-/r/
frac-times
flip--
flip-+
flip3--
flip3-+
add-cube-cbrt
add-exp-log
associate-*r/
associate-*l/
add-cbrt-cube
*-un-lft-identity
pow1
add-sqr-sqrt
associate-*l*
associate-*r*
add-log-exp
distribute-lft-in
sub-neg
distribute-rgt-in
div-inv
cbrt-unprod
*-commutative
prod-exp
pow-prod-down
frac-2neg
associate-/r*
clear-num
Counts
2 → 48
Calls
2 calls:
Slowest
8.0ms
(* (+ x 1) (- x 1))
3.0ms
(/ -2 (* (+ x 1) (- x 1)))

series73.0ms

Counts
2 → 6
Calls
2 calls:
Slowest
42.0ms
(* (+ x 1) (- x 1))
31.0ms
(/ -2 (* (+ x 1) (- x 1)))

simplify4.6s

Counts
39 → 54
Calls
39 calls:
Slowest
1.3s
(* (* (* (+ x 1) (+ x 1)) (+ x 1)) (* (* (- x 1) (- x 1)) (- x 1)))
445.0ms
(- (+ (* 2 (/ 1 (pow x 4))) (+ (* 2 (/ 1 (pow x 6))) (* 2 (/ 1 (pow x 2))))))
328.0ms
(- (+ (* 2 (/ 1 (pow x 4))) (+ (* 2 (/ 1 (pow x 6))) (* 2 (/ 1 (pow x 2))))))
268.0ms
(* (- (* x x) (* 1 1)) (- (* x x) (* 1 1)))
234.0ms
(* (+ (pow x 3) (pow 1 3)) (- (* x x) (* 1 1)))

prune380.0ms

Pruning

5 alts after pruning (3 fresh and 2 done)

Merged error: 0.0b

localize5.0ms

Local error

Found 2 expressions with local error:

0.1b
(/ (/ -2 (+ x 1)) (- x 1))
0.0b
(/ -2 (+ x 1))

rewrite10.0ms

Algorithm
rewrite-expression-head
Rules
18×times-frac
14×add-cube-cbrt
14×*-un-lft-identity
14×add-sqr-sqrt
12×associate-/r/
associate-/l*
div-inv
associate-/r*
flip-+
flip3-+
add-exp-log
add-cbrt-cube
add-log-exp
frac-2neg
clear-num
pow1
associate-/l/
flip--
div-exp
flip3--
cbrt-undiv
Counts
2 → 57
Calls
2 calls:
Slowest
8.0ms
(/ (/ -2 (+ x 1)) (- x 1))
1.0ms
(/ -2 (+ x 1))

series33.0ms

Counts
2 → 6
Calls
2 calls:
Slowest
26.0ms
(/ (/ -2 (+ x 1)) (- x 1))
7.0ms
(/ -2 (+ x 1))

simplify4.0s

Counts
58 → 63
Calls
58 calls:
Slowest
452.0ms
(- (+ (* 2 (/ 1 (pow x 4))) (+ (* 2 (/ 1 (pow x 6))) (* 2 (/ 1 (pow x 2))))))
442.0ms
(/ (/ -2 (- (* x x) (* 1 1))) (sqrt (- x 1)))
426.0ms
(- (+ (* 2 (/ 1 (pow x 4))) (+ (* 2 (/ 1 (pow x 6))) (* 2 (/ 1 (pow x 2))))))
362.0ms
(- (* 2 (/ 1 (pow x 2))) (+ (* 2 (/ 1 (pow x 3))) (* 2 (/ 1 x))))
326.0ms
(/ (* (* (/ -2 (+ x 1)) (/ -2 (+ x 1))) (/ -2 (+ x 1))) (* (* (- x 1) (- x 1)) (- x 1)))

prune397.0ms

Pruning

5 alts after pruning (3 fresh and 2 done)

Merged error: 0b

localize49.0ms

Local error

Found 4 expressions with local error:

13.7b
(/ (- x 1) (+ (* x x) (- (* 1 1) (* x 1))))
3.4b
(/ (/ -2 (+ 1 (pow x 3))) (/ (- x 1) (+ (* x x) (- (* 1 1) (* x 1)))))
0.2b
(/ -2 (+ 1 (pow x 3)))
0.0b
(+ (* x x) (- (* 1 1) (* x 1)))

rewrite57.0ms

Algorithm
rewrite-expression-head
Rules
162×times-frac
78×add-cube-cbrt
78×*-un-lft-identity
78×add-sqr-sqrt
51×associate-/r/
26×div-inv
26×flip-+
26×flip3-+
21×associate-/r*
11×add-exp-log
11×add-cbrt-cube
add-log-exp
associate-/l*
div-exp
cbrt-undiv
pow1
associate-/l/
frac-2neg
clear-num
sum-log
associate-+r+
flip--
div-sub
diff-log
flip3--
sub-neg
associate-+r-
+-commutative
Counts
4 → 189
Calls
4 calls:
Slowest
21.0ms
(/ (- x 1) (+ (* x x) (- (* 1 1) (* x 1))))
20.0ms
(/ (/ -2 (+ 1 (pow x 3))) (/ (- x 1) (+ (* x x) (- (* 1 1) (* x 1)))))
9.0ms
(+ (* x x) (- (* 1 1) (* x 1)))
1.0ms
(/ -2 (+ 1 (pow x 3)))

series139.0ms

Counts
4 → 12
Calls
4 calls:
Slowest
62.0ms
(/ (/ -2 (+ 1 (pow x 3))) (/ (- x 1) (+ (* x x) (- (* 1 1) (* x 1)))))
35.0ms
(/ -2 (+ 1 (pow x 3)))
30.0ms
(/ (- x 1) (+ (* x x) (- (* 1 1) (* x 1))))
12.0ms
(+ (* x x) (- (* 1 1) (* x 1)))

simplify36.9s

Counts
256 → 201
Calls
256 calls:
Slowest
671.0ms
(/ (/ -2 (- (* 1 1) (* (pow x 3) (pow x 3)))) (/ (* (cbrt (- x 1)) (cbrt (- x 1))) 1))
670.0ms
(/ (+ (* 1 1) (- (* (pow x 3) (pow x 3)) (* 1 (pow x 3)))) (/ (cbrt (- x 1)) (cbrt (+ (* x x) (- (* 1 1) (* x 1))))))
560.0ms
(/ (sqrt (/ -2 (+ 1 (pow x 3)))) (+ (* (* x x) (* x x)) (- (* (- (* 1 1) (* x 1)) (- (* 1 1) (* x 1))) (* (* x x) (- (* 1 1) (* x 1))))))
516.0ms
(/ (/ -2 (- (* 1 1) (* (pow x 3) (pow x 3)))) (/ 1 (* (cbrt (+ (* x x) (- (* 1 1) (* x 1)))) (cbrt (+ (* x x) (- (* 1 1) (* x 1)))))))
511.0ms
(/ (cbrt (/ -2 (+ 1 (pow x 3)))) (+ (* (* x x) (* x x)) (- (* (- (* 1 1) (* x 1)) (- (* 1 1) (* x 1))) (* (* x x) (- (* 1 1) (* x 1))))))

prune2.2s

Pruning

5 alts after pruning (2 fresh and 3 done)

Merged error: 0b

regimes28.0ms

Accuracy

0% (0.1b remaining)

Error of 0.1b against oracle of 0.0b and baseline of 0.1b

bsearch2.0ms

end0.0ms

sample2.1s

Algorithm
intervals
Results
804.0ms4232×body80valid
738.0ms1841×body640valid
341.0ms1289×body320valid
100.0ms638×body160valid