Average Error: 0.0 → 0.0
Time: 10.8s
Precision: 64
Internal Precision: 128
\[\frac{-\left(f + n\right)}{f - n}\]
\[\frac{-1}{\frac{f}{f + n} - \frac{n}{f + n}}\]

Error

Bits error versus f

Bits error versus n

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 0.0

    \[\frac{-\left(f + n\right)}{f - n}\]
  2. Using strategy rm
  3. Applied *-un-lft-identity0.0

    \[\leadsto \frac{-\color{blue}{1 \cdot \left(f + n\right)}}{f - n}\]
  4. Applied distribute-lft-neg-in0.0

    \[\leadsto \frac{\color{blue}{\left(-1\right) \cdot \left(f + n\right)}}{f - n}\]
  5. Applied associate-/l*0.0

    \[\leadsto \color{blue}{\frac{-1}{\frac{f - n}{f + n}}}\]
  6. Simplified0.0

    \[\leadsto \frac{\color{blue}{-1}}{\frac{f - n}{f + n}}\]
  7. Using strategy rm
  8. Applied div-sub0.0

    \[\leadsto \frac{-1}{\color{blue}{\frac{f}{f + n} - \frac{n}{f + n}}}\]
  9. Final simplification0.0

    \[\leadsto \frac{-1}{\frac{f}{f + n} - \frac{n}{f + n}}\]

Reproduce

herbie shell --seed 2018362 
(FPCore (f n)
  :name "subtraction fraction"
  (/ (- (+ f n)) (- f n)))

Details

Time bar (total: 9.2s)Debug log

start881.0ms

Algorithm
intervals

setup103.0ms

Pruning

1 alts after pruning (1 fresh and 0 done)

Merged error: 0.0b

localize61.0ms

Local error

Found 1 expressions with local error:

0.0b
(/ (- (+ f n)) (- f n))

rewrite9.0ms

Algorithm
rewrite-expression-head
Counts
1 → 61
Calls

1 calls. Slowest were:

7.0ms
(/ (- (+ f n)) (- f n))

series66.0ms

Counts
1 → 3
Calls

1 calls. Slowest were:

65.0ms
(/ (- (+ f n)) (- f n))

simplify1.1s

Counts
81 → 64
Calls

81 calls. Slowest were:

168.0ms
(- (- (* f f) (* n n)))
130.0ms
(/ (* (* (- (+ f n)) (- (+ f n))) (- (+ f n))) (* (* (- f n) (- f n)) (- f n)))
64.0ms
(/ (- (* (cbrt (+ f n)) (cbrt (+ f n)))) (* (cbrt (- f n)) (cbrt (- f n))))

prune565.0ms

Pruning

4 alts after pruning (4 fresh and 0 done)

Merged error: 0.0b

localize11.0ms

Local error

Found 2 expressions with local error:

0.0b
(/ (- f n) (+ f n))
0.0b
(/ -1 (/ (- f n) (+ f n)))

rewrite8.0ms

Algorithm
rewrite-expression-head
Counts
2 → 58
Calls

2 calls. Slowest were:

5.0ms
(/ (- f n) (+ f n))
1.0ms
(/ -1 (/ (- f n) (+ f n)))

series88.0ms

Counts
2 → 6
Calls

2 calls. Slowest were:

46.0ms
(/ (- f n) (+ f n))
43.0ms
(/ -1 (/ (- f n) (+ f n)))

simplify786.0ms

Counts
52 → 64
Calls

52 calls. Slowest were:

344.0ms
(/ (* (* (- f n) (- f n)) (- f n)) (* (* (+ f n) (+ f n)) (+ f n)))
57.0ms
(+ (* f f) (- (* n n) (* f n)))
51.0ms
(+ (* f f) (- (* n n) (* f n)))

prune556.0ms

Pruning

3 alts after pruning (3 fresh and 0 done)

Merged error: 0b

localize10.0ms

Local error

Found 4 expressions with local error:

0.0b
(/ n (+ f n))
0.0b
(- (/ f (+ f n)) (/ n (+ f n)))
0.0b
(/ f (+ f n))
0.0b
(/ -1 (- (/ f (+ f n)) (/ n (+ f n))))

rewrite9.0ms

Algorithm
rewrite-expression-head
Counts
4 → 71
Calls

4 calls. Slowest were:

5.0ms
(- (/ f (+ f n)) (/ n (+ f n)))
3.0ms
(/ -1 (- (/ f (+ f n)) (/ n (+ f n))))
0.0ms
(/ n (+ f n))

series153.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

53.0ms
(- (/ f (+ f n)) (/ n (+ f n)))
44.0ms
(/ -1 (- (/ f (+ f n)) (/ n (+ f n))))
28.0ms
(/ f (+ f n))
27.0ms
(/ n (+ f n))

simplify1.1s

Counts
48 → 83
Calls

48 calls. Slowest were:

426.0ms
(- (* f (+ f n)) (* (+ f n) n))
120.0ms
(- (/ f (- (* f f) (* n n))) (/ n (- (* f f) (* n n))))
99.0ms
(- (/ f (- (* f f) (* n n))) (/ n (- (* f f) (* n n))))

prune868.0ms

Pruning

3 alts after pruning (2 fresh and 1 done)

Merged error: 0b

localize16.0ms

Local error

Found 4 expressions with local error:

0.0b
(* (/ -1 (- (/ f (+ f n)) (/ n (+ f n)))) (/ -1 (- (/ f (+ f n)) (/ n (+ f n)))))
0.0b
(/ n (+ f n))
0.0b
(/ n (+ f n))
0.0b
(/ n (+ f n))

rewrite7.0ms

Algorithm
rewrite-expression-head
Counts
4 → 78
Calls

4 calls. Slowest were:

4.0ms
(* (/ -1 (- (/ f (+ f n)) (/ n (+ f n)))) (/ -1 (- (/ f (+ f n)) (/ n (+ f n)))))
0.0ms
(/ n (+ f n))
0.0ms
(/ n (+ f n))

series122.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

54.0ms
(* (/ -1 (- (/ f (+ f n)) (/ n (+ f n)))) (/ -1 (- (/ f (+ f n)) (/ n (+ f n)))))
25.0ms
(/ n (+ f n))
23.0ms
(/ n (+ f n))
20.0ms
(/ n (+ f n))

simplify1.7s

Counts
51 → 90
Calls

51 calls. Slowest were:

338.0ms
(/ -1 (- (* f (+ f n)) (* (+ f n) n)))
232.0ms
(/ -1 (- (pow (/ f (+ f n)) 3) (pow (/ n (+ f n)) 3)))
217.0ms
(* (- (/ f (+ f n)) (/ n (+ f n))) (- (/ f (+ f n)) (/ n (+ f n))))

prune940.0ms

Pruning

3 alts after pruning (1 fresh and 2 done)

Merged error: 0b

regimes72.0ms

Accuracy

0% (0.0b remaining)

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

bsearch2.0ms