Average Error: 0.0 → 0.0
Time: 28.8s
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 +o rules:numerics
(FPCore (f n)
  :name "subtraction fraction"
  (/ (- (+ f n)) (- f n)))

Details

Time bar (total: 28.4s)Debug log

sample109.0ms

Algorithm
intervals
Results
16.0ms256×body80valid

simplify145.0ms

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

prune8.0ms

Pruning

1 alts after pruning (1 fresh and 0 done)

Merged error: 0.0b

localize14.0ms

Local error

Found 1 expressions with local error:

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

rewrite15.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
log1p-expm1-u
flip-+
distribute-frac-neg
div-exp
div-sub
flip3--
flip3-+
frac-2neg
clear-num
cbrt-undiv
pow1
expm1-log1p-u
neg-sub0
Counts
1 → 63
Calls
1 calls:
Slowest
11.0ms
(/ (- (+ f n)) (- f n))

series53.0ms

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

simplify1.2s

Counts
81 → 66
Calls
81 calls:
Slowest
228.0ms
(- (- (* f f) (* n n)))
79.0ms
(/ (* (* (- (+ f n)) (- (+ f n))) (- (+ f n))) (* (* (- f n) (- f n)) (- f n)))
73.0ms
(/ (- (* (cbrt (+ f n)) (cbrt (+ f n)))) (* (cbrt (- f n)) (cbrt (- f n))))
34.0ms
(/ (* (cbrt (+ f n)) (cbrt (+ f n))) 1)
34.0ms
(/ (* (cbrt (+ f n)) (cbrt (+ f n))) (* (cbrt (- f n)) (cbrt (- f n))))

prune470.0ms

Pruning

4 alts after pruning (3 fresh and 1 done)

Merged error: 0.0b

localize39.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))))

rewrite57.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
log1p-expm1-u
frac-2neg
clear-num
pow1
expm1-log1p-u
flip-+
flip3-+
associate-*r/
associate-*l/
frac-times
Counts
4 → 170
Calls
4 calls:
Slowest
27.0ms
(/ (/ (- (- n) f) (- f n)) (* (/ (- f n) (+ n f)) (/ (- f n) (+ n f))))
15.0ms
(/ (- (- n) f) (- f n))
5.0ms
(/ (- f n) (+ n f))
5.0ms
(/ (- f n) (+ n f))

series566.0ms

Counts
4 → 12
Calls
4 calls:
Slowest
434.0ms
(/ (/ (- (- n) f) (- f n)) (* (/ (- f n) (+ n f)) (/ (- f n) (+ n f))))
54.0ms
(/ (- f n) (+ n f))
43.0ms
(/ (- (- n) f) (- f n))
35.0ms
(/ (- f n) (+ n f))

simplify13.9s

Counts
172 → 182
Calls
172 calls:
Slowest
464.0ms
(- (- (log (- (- n) f)) (log (- f n))) (+ (log (/ (- f n) (+ n f))) (- (log (- f n)) (log (+ n f)))))
405.0ms
(/ (/ (- (- n) f) (- f n)) (/ (- f n) (+ n f)))
395.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)))))
392.0ms
(- (- (log (- (- n) f)) (log (- f n))) (+ (log (/ (- f n) (+ n f))) (log (/ (- f n) (+ n f)))))
383.0ms
(/ (* (* (/ (- (- n) f) (- f n)) (/ (- (- n) f) (- f n))) (/ (- (- n) f) (- f n))) (* (/ (* (* (- f n) (- f n)) (- f n)) (* (* (+ n f) (+ n f)) (+ n f))) (/ (* (* (- f n) (- f n)) (- f n)) (* (* (+ n f) (+ n f)) (+ n f)))))

prune1.7s

Pruning

3 alts after pruning (2 fresh and 1 done)

Merged error: 0b

localize36.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))

rewrite21.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
log1p-expm1-u
flip-+
div-exp
div-sub
flip3--
flip3-+
frac-2neg
clear-num
cbrt-undiv
pow1
expm1-log1p-u
Counts
4 → 136
Calls
4 calls:
Slowest
5.0ms
(/ (- f n) (+ n f))
5.0ms
(/ (- f n) (+ n f))
5.0ms
(/ (- f n) (+ n f))
4.0ms
(/ (- f n) (+ n f))

series145.0ms

Counts
4 → 12
Calls
4 calls:
Slowest
38.0ms
(/ (- f n) (+ n f))
37.0ms
(/ (- f n) (+ n f))
36.0ms
(/ (- f n) (+ n f))
34.0ms
(/ (- f n) (+ n f))

simplify2.6s

Counts
132 → 148
Calls
132 calls:
Slowest
362.0ms
(/ (* (* (- f n) (- f n)) (- f n)) (* (* (+ n f) (+ n f)) (+ n f)))
352.0ms
(/ (* (* (- f n) (- f n)) (- f n)) (* (* (+ n f) (+ n f)) (+ n f)))
321.0ms
(/ (* (* (- f n) (- f n)) (- f n)) (* (* (+ n f) (+ n f)) (+ n f)))
298.0ms
(/ (* (* (- f n) (- f n)) (- f n)) (* (* (+ n f) (+ n f)) (+ n f)))
87.0ms
(+ (* n n) (- (* f f) (* n f)))

prune1.9s

Pruning

3 alts after pruning (1 fresh and 2 done)

Merged error: 0b

localize20.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))

rewrite23.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
log1p-expm1-u
div-exp
div-sub
frac-2neg
clear-num
cbrt-undiv
pow1
expm1-log1p-u
flip-+
flip3-+
Counts
4 → 136
Calls
4 calls:
Slowest
8.0ms
(/ (- (- n) f) (- f n))
8.0ms
(/ (- (- n) f) (- f n))
3.0ms
(/ (- f n) (+ n f))
3.0ms
(/ (- f n) (+ n f))

series141.0ms

Counts
4 → 12
Calls
4 calls:
Slowest
38.0ms
(/ (- (- n) f) (- f n))
37.0ms
(/ (- (- n) f) (- f n))
35.0ms
(/ (- f n) (+ n f))
32.0ms
(/ (- f n) (+ n f))

simplify3.0s

Counts
132 → 148
Calls
132 calls:
Slowest
325.0ms
(/ (* (cbrt (- (- n) f)) (cbrt (- (- n) f))) 1)
280.0ms
(/ (* (* (- f n) (- f n)) (- f n)) (* (* (+ n f) (+ n f)) (+ n f)))
274.0ms
(/ (* (* (- f n) (- f n)) (- f n)) (* (* (+ n f) (+ n f)) (+ n f)))
270.0ms
(/ (* (* (- (- n) f) (- (- n) f)) (- (- n) f)) (* (* (- f n) (- f n)) (- f n)))
217.0ms
(/ (* (* (- (- n) f) (- (- n) f)) (- (- n) f)) (* (* (- f n) (- f n)) (- f n)))

prune1.6s

Pruning

3 alts after pruning (0 fresh and 3 done)

Merged error: 0b

regimes81.0ms

Accuracy

0% (0.0b remaining)

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

bsearch2.0ms

end0.0ms

sample629.0ms

Algorithm
intervals
Results
517.0ms8000×body80valid