Average Error: 0.0 → 0.0
Time: 26.2s
Precision: 64
Internal Precision: 128
\[\frac{-\left(f + n\right)}{f - n}\]
\[-\frac{n + f}{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. Final simplification0.0

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

Reproduce

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

Details

Time bar (total: 25.9s)Debug log

sample96.0ms

Algorithm
intervals
Results
20.0ms256×body80valid

simplify73.0ms

Counts
1 → 1
Calls
1 calls:
Slowest
72.0ms
(/ (- (+ f n)) (- f n))

prune10.0ms

Pruning

1 alts after pruning (1 fresh and 0 done)

Merged error: 0.0b

localize22.0ms

Local error

Found 1 expressions with local error:

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

rewrite13.0ms

Algorithm
rewrite-expression-head
Rules
30×times-frac
24×add-cube-cbrt
24×*-un-lft-identity
24×add-sqr-sqrt
12×distribute-rgt-neg-in
12×distribute-lft-neg-in
10×associate-/l*
neg-mul-1
add-exp-log
add-cbrt-cube
associate-/r*
associate-/l/
distribute-neg-frac
associate-/r/
add-log-exp
flip--
div-inv
flip-+
distribute-frac-neg
div-exp
div-sub
flip3--
flip3-+
frac-2neg
clear-num
cbrt-undiv
pow1
neg-sub0
Counts
1 → 61
Calls
1 calls:
Slowest
9.0ms
(/ (- (+ f n)) (- f n))

series61.0ms

Counts
1 → 3
Calls
1 calls:
Slowest
61.0ms
(/ (- (+ f n)) (- f n))

simplify938.0ms

Counts
81 → 64
Calls
81 calls:
Slowest
148.0ms
(- (- (* f f) (* n n)))
91.0ms
(/ (* (* (- (+ f n)) (- (+ f n))) (- (+ f n))) (* (* (- f n) (- f n)) (- f n)))
41.0ms
(/ (- (* (cbrt (+ f n)) (cbrt (+ f n)))) (* (cbrt (- f n)) (cbrt (- f n))))
27.0ms
(/ (- (+ f n)) (cbrt (- f n)))
26.0ms
(/ (* (cbrt (- (+ f n))) (cbrt (- (+ f n)))) (* (cbrt (- f n)) (cbrt (- f n))))

prune441.0ms

Pruning

4 alts after pruning (3 fresh and 1 done)

Merged error: 0.0b

localize19.0ms

Local error

Found 4 expressions with local error:

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

rewrite33.0ms

Algorithm
rewrite-expression-head
Rules
60×times-frac
51×add-exp-log
51×add-cbrt-cube
42×add-cube-cbrt
42×*-un-lft-identity
42×add-sqr-sqrt
26×div-exp
26×cbrt-undiv
24×associate-/l*
13×associate-/r/
10×associate-/r*
cbrt-unprod
prod-exp
associate-/l/
flip--
div-inv
flip3--
div-sub
add-log-exp
frac-2neg
clear-num
pow1
flip-+
flip3-+
associate-*r/
associate-*l/
frac-times
Counts
4 → 162
Calls
4 calls:
Slowest
18.0ms
(/ (/ (- (- n) f) (- f n)) (* (/ (- f n) (+ n f)) (/ (- f n) (+ n f))))
7.0ms
(/ (- (- n) f) (- f n))
3.0ms
(/ (- f n) (+ n f))
3.0ms
(/ (- f n) (+ n f))

series180.0ms

Counts
4 → 12
Calls
4 calls:
Slowest
54.0ms
(/ (- (- n) f) (- f n))
49.0ms
(/ (/ (- (- n) f) (- f n)) (* (/ (- f n) (+ n f)) (/ (- f n) (+ n f))))
45.0ms
(/ (- f n) (+ n f))
32.0ms
(/ (- f n) (+ n f))

simplify13.1s

Counts
172 → 174
Calls
172 calls:
Slowest
435.0ms
(/ (* (cbrt (- (- n) f)) (cbrt (- (- n) f))) (* (cbrt (- f n)) (cbrt (- f n))))
418.0ms
(- (- (log (- (- n) f)) (log (- f n))) (+ (log (/ (- f n) (+ n f))) (- (log (- f n)) (log (+ n f)))))
381.0ms
(- (- (log (- (- n) f)) (log (- f n))) (+ (- (log (- f n)) (log (+ n f))) (log (/ (- f n) (+ n f)))))
380.0ms
(/ (/ (* (* (- (- n) f) (- (- n) f)) (- (- n) f)) (* (* (- f n) (- f n)) (- f n))) (* (* (* (/ (- f n) (+ n f)) (/ (- f n) (+ n f))) (/ (- f n) (+ n f))) (/ (* (* (- f n) (- f n)) (- f n)) (* (* (+ n f) (+ n f)) (+ n f)))))
353.0ms
(- (- (log (- (- n) f)) (log (- f n))) (+ (log (/ (- f n) (+ n f))) (log (/ (- f n) (+ n f)))))

prune1.7s

Pruning

3 alts after pruning (2 fresh and 1 done)

Merged error: 0b

localize18.0ms

Local error

Found 4 expressions with local error:

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

rewrite11.0ms

Algorithm
rewrite-expression-head
Rules
36×add-cube-cbrt
36×times-frac
36×*-un-lft-identity
36×add-sqr-sqrt
12×associate-/l*
12×add-exp-log
12×add-cbrt-cube
12×associate-/r*
associate-/l/
associate-/r/
add-log-exp
flip--
div-inv
flip-+
div-exp
div-sub
flip3--
flip3-+
frac-2neg
clear-num
cbrt-undiv
pow1
Counts
4 → 128
Calls
4 calls:
Slowest
3.0ms
(/ (- f n) (+ n f))
2.0ms
(/ (- f n) (+ n f))
2.0ms
(/ (- f n) (+ n f))
2.0ms
(/ (- f n) (+ n f))

series150.0ms

Counts
4 → 12
Calls
4 calls:
Slowest
55.0ms
(/ (- f n) (+ n f))
34.0ms
(/ (- f n) (+ n f))
30.0ms
(/ (- f n) (+ n f))
30.0ms
(/ (- f n) (+ n f))

simplify2.0s

Counts
132 → 140
Calls
132 calls:
Slowest
298.0ms
(/ (* (* (- f n) (- f n)) (- f n)) (* (* (+ n f) (+ n f)) (+ n f)))
277.0ms
(/ (* (* (- f n) (- f n)) (- f n)) (* (* (+ n f) (+ n f)) (+ n f)))
245.0ms
(/ (* (* (- f n) (- f n)) (- f n)) (* (* (+ n f) (+ n f)) (+ n f)))
221.0ms
(/ (* (* (- f n) (- f n)) (- f n)) (* (* (+ n f) (+ n f)) (+ n f)))
65.0ms
(+ (* n n) (- (* f f) (* n f)))

prune1.7s

Pruning

3 alts after pruning (1 fresh and 2 done)

Merged error: 0b

localize34.0ms

Local error

Found 4 expressions with local error:

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

rewrite41.0ms

Algorithm
rewrite-expression-head
Rules
36×add-cube-cbrt
36×times-frac
36×*-un-lft-identity
36×add-sqr-sqrt
12×associate-/l*
12×add-exp-log
12×add-cbrt-cube
12×associate-/r*
associate-/l/
associate-/r/
flip--
flip3--
add-log-exp
div-inv
div-exp
div-sub
frac-2neg
clear-num
cbrt-undiv
pow1
flip-+
flip3-+
Counts
4 → 128
Calls
4 calls:
Slowest
14.0ms
(/ (- (- n) f) (- f n))
14.0ms
(/ (- (- n) f) (- f n))
5.0ms
(/ (- f n) (+ n f))
5.0ms
(/ (- f n) (+ n f))

series184.0ms

Counts
4 → 12
Calls
4 calls:
Slowest
53.0ms
(/ (- f n) (+ n f))
51.0ms
(/ (- f n) (+ n f))
42.0ms
(/ (- (- n) f) (- f n))
38.0ms
(/ (- (- n) f) (- f n))

simplify2.3s

Counts
132 → 140
Calls
132 calls:
Slowest
285.0ms
(/ (* (* (- f n) (- f n)) (- f n)) (* (* (+ n f) (+ n f)) (+ n f)))
265.0ms
(/ (* (* (- (- n) f) (- (- n) f)) (- (- n) f)) (* (* (- f n) (- f n)) (- f n)))
254.0ms
(/ (* (* (- f n) (- f n)) (- f n)) (* (* (+ n f) (+ n f)) (+ n f)))
201.0ms
(/ (* (* (- (- n) f) (- (- n) f)) (- (- n) f)) (* (* (- f n) (- f n)) (- f n)))
172.0ms
(- (* (- n) (- n)) (* f f))

prune1.7s

Pruning

3 alts after pruning (0 fresh and 3 done)

Merged error: 0b

regimes92.0ms

Accuracy

0% (0.0b remaining)

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

bsearch3.0ms

end0.0ms

sample979.0ms

Algorithm
intervals
Results
559.0ms8000×body80valid