Average Error: 0.0 → 0.0
Time: 22.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 2019016 
(FPCore (f n)
  :name "subtraction fraction"
  (/ (- (+ f n)) (- f n)))

Details

Time bar (total: 22.5s)Debug log

sample100.0ms

Algorithm
intervals
Results
256×(pre true 80)
256×(body real 80)

simplify418.0ms

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

prune6.0ms

Pruning

1 alts after pruning (1 fresh and 0 done)

Merged error: 0.0b

localize13.0ms

Local error

Found 1 expressions with local error:

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

rewrite14.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
10.0ms
(/ (- (+ f n)) (- f n))

series63.0ms

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

simplify1.1s

Counts
81 → 64
Calls
81 calls:
Slowest
168.0ms
(- (- (* f f) (* n n)))
117.0ms
(/ (* (* (- (+ f n)) (- (+ f n))) (- (+ f n))) (* (* (- f n) (- f n)) (- f n)))
56.0ms
(/ (- (* (cbrt (+ f n)) (cbrt (+ f n)))) (* (cbrt (- f n)) (cbrt (- f n))))
39.0ms
(/ (* (cbrt (- (+ f n))) (cbrt (- (+ f n)))) (* (cbrt (- f n)) (cbrt (- f n))))
32.0ms
(/ (* (cbrt (+ f n)) (cbrt (+ f n))) 1)

prune586.0ms

Pruning

3 alts after pruning (2 fresh and 1 done)

Merged error: 0.0b

localize10.0ms

Local error

Found 2 expressions with local error:

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

rewrite12.0ms

Algorithm
rewrite-expression-head
Rules
10×associate-*l*
add-cube-cbrt
add-exp-log
*-un-lft-identity
add-sqr-sqrt
associate-*r*
pow1
distribute-neg-frac
associate-/r/
add-cbrt-cube
distribute-rgt-neg-in
associate-/r*
distribute-lft-neg-in
add-log-exp
flip--
div-inv
flip-+
prod-exp
associate-*l/
flip3--
flip3-+
rec-exp
frac-times
inv-pow
pow-flip
cbrt-unprod
*-commutative
un-div-inv
associate-*r/
pow-prod-down
frac-2neg
neg-mul-1
clear-num
distribute-lft-neg-out
Counts
2 → 53
Calls
2 calls:
Slowest
10.0ms
(* (- (+ f n)) (/ 1 (- f n)))
2.0ms
(/ 1 (- f n))

series84.0ms

Counts
2 → 6
Calls
2 calls:
Slowest
57.0ms
(* (- (+ f n)) (/ 1 (- f n)))
27.0ms
(/ 1 (- f n))

simplify1.8s

Counts
38 → 59
Calls
38 calls:
Slowest
434.0ms
(* (- (+ (pow f 3) (pow n 3))) (/ 1 (- f n)))
321.0ms
(* (+ (* f f) (- (* n n) (* f n))) (- f n))
222.0ms
(* (- (- (* f f) (* n n))) 1)
193.0ms
(* (- (+ f n)) (/ 1 (- f n)))
128.0ms
(* (* (* (- (+ f n)) (- (+ f n))) (- (+ f n))) (* (* (/ 1 (- f n)) (/ 1 (- f n))) (/ 1 (- f n))))

prune422.0ms

Pruning

4 alts after pruning (2 fresh and 2 done)

Merged error: 0b

localize13.0ms

Local error

Found 4 expressions with local error:

0.6b
(cbrt (+ f n))
0.6b
(cbrt (+ f n))
0.6b
(cbrt (+ f n))
0.5b
(* (cbrt (+ f n)) (cbrt (+ f n)))

rewrite18.0ms

Algorithm
rewrite-expression-head
Rules
18×cbrt-div
15×cbrt-prod
11×add-cube-cbrt
11×*-un-lft-identity
11×add-sqr-sqrt
flip-+
flip3-+
pow1
pow1/3
add-exp-log
associate-*l*
associate-*r*
add-log-exp
add-cbrt-cube
frac-times
pow-prod-up
associate-*r/
associate-*l/
pow-prod-down
cbrt-unprod
*-commutative
prod-exp
pow-plus
pow2
Counts
4 → 75
Calls
4 calls:
Slowest
10.0ms
(* (cbrt (+ f n)) (cbrt (+ f n)))
4.0ms
(cbrt (+ f n))
1.0ms
(cbrt (+ f n))
1.0ms
(cbrt (+ f n))

series672.0ms

Counts
4 → 12
Calls
4 calls:
Slowest
207.0ms
(* (cbrt (+ f n)) (cbrt (+ f n)))
164.0ms
(cbrt (+ f n))
159.0ms
(cbrt (+ f n))
141.0ms
(cbrt (+ f n))

simplify1.6s

Counts
59 → 87
Calls
59 calls:
Slowest
223.0ms
(- (+ (* 1/3 (* (pow (/ 1 (pow n 2)) 1/3) f)) (pow n 1/3)) (* 1/9 (* (pow (/ 1 (pow n 5)) 1/3) (pow f 2))))
178.0ms
(- (+ (* 1/3 (* (pow (/ 1 (pow n 2)) 1/3) f)) (pow n 1/3)) (* 1/9 (* (pow (/ 1 (pow n 5)) 1/3) (pow f 2))))
161.0ms
(- (+ (* 1/3 (* (pow (/ 1 (pow n 2)) 1/3) f)) (pow n 1/3)) (* 1/9 (* (pow (/ 1 (pow n 5)) 1/3) (pow f 2))))
145.0ms
(- (+ (* 2/3 (* (pow (/ 1 n) 1/3) f)) (pow n 2/3)) (* 1/9 (* (pow (/ 1 (pow n 4)) 1/3) (pow f 2))))
115.0ms
(* (cbrt (+ (pow f 3) (pow n 3))) (cbrt (- (* f f) (* n n))))

prune818.0ms

Pruning

4 alts after pruning (1 fresh and 3 done)

Merged error: 0b

localize48.0ms

Local error

Found 4 expressions with local error:

33.2b
(* (* (- (+ f n)) (/ 1 (- (pow f 3) (pow n 3)))) (+ (* f f) (* (+ f n) n)))
11.0b
(* (- (+ f n)) (/ 1 (- (pow f 3) (pow n 3))))
5.0b
(- (pow f 3) (pow n 3))
1.4b
(+ (* f f) (* (+ f n) n))

rewrite50.0ms

Algorithm
rewrite-expression-head
Rules
20×frac-times
16×distribute-neg-frac
16×flip-+
16×add-exp-log
16×flip3-+
14×associate-*l/
11×associate-*l*
11×add-cbrt-cube
11×*-un-lft-identity
11×pow1
11×add-sqr-sqrt
add-cube-cbrt
associate-*r*
add-log-exp
prod-exp
associate-*r/
cbrt-unprod
un-div-inv
pow-prod-down
distribute-rgt-neg-in
distribute-lft-neg-in
distribute-lft-neg-out
flip--
*-commutative
associate-/r/
flip3--
rec-exp
difference-of-squares
distribute-lft-out--
div-inv
diff-log
distribute-lft-in
sub-neg
sum-log
neg-mul-1
+-commutative
difference-cubes
distribute-rgt-in
Counts
4 → 103
Calls
4 calls:
Slowest
34.0ms
(* (* (- (+ f n)) (/ 1 (- (pow f 3) (pow n 3)))) (+ (* f f) (* (+ f n) n)))
8.0ms
(* (- (+ f n)) (/ 1 (- (pow f 3) (pow n 3))))
3.0ms
(- (pow f 3) (pow n 3))
2.0ms
(+ (* f f) (* (+ f n) n))

series166.0ms

Counts
4 → 12
Calls
4 calls:
Slowest
72.0ms
(* (* (- (+ f n)) (/ 1 (- (pow f 3) (pow n 3)))) (+ (* f f) (* (+ f n) n)))
41.0ms
(- (pow f 3) (pow n 3))
36.0ms
(* (- (+ f n)) (/ 1 (- (pow f 3) (pow n 3))))
17.0ms
(+ (* f f) (* (+ f n) n))

simplify11.9s

Counts
91 → 115
Calls
91 calls:
Slowest
640.0ms
(* (- (pow f 3) (pow n 3)) (- (* f f) (* (+ f n) n)))
613.0ms
(* (* (+ (* f f) (- (* n n) (* f n))) (- (pow f 3) (pow n 3))) (- (* f f) (* (+ f n) n)))
562.0ms
(* (- (pow f 3) (pow n 3)) (- (* f f) (* (+ f n) n)))
550.0ms
(* (* (- (- (* f f) (* n n))) 1) (+ (* f f) (* (+ f n) n)))
492.0ms
(* (- (+ f n)) (- (* (* f f) (* f f)) (* (* (+ f n) n) (* (+ f n) n))))

prune1.4s

Pruning

4 alts after pruning (0 fresh and 4 done)

Merged error: 0b

regimes95.0ms

Accuracy

0% (0.0b remaining)

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

bsearch2.0ms

end0.0ms

sample1.2s

Algorithm
intervals
Results
8000×(pre true 80)
8000×(body real 80)