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

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 log1p-expm1-u0.0

    \[\leadsto \color{blue}{\log_* (1 + (e^{\frac{-\left(f + n\right)}{f - n}} - 1)^*)}\]
  4. Final simplification0.0

    \[\leadsto \log_* (1 + (e^{-\frac{n + f}{f - n}} - 1)^*)\]

Reproduce

herbie shell --seed 2018365 +o rules:numerics
(FPCore (f n)
  :name "subtraction fraction"
  (/ (- (+ f n)) (- f n)))

Details

Time bar (total: 11.1s)Debug log

start162.0ms

Algorithm
intervals

setup110.0ms

Pruning

1 alts after pruning (1 fresh and 0 done)

Merged error: 0.0b

localize26.0ms

Local error

Found 1 expressions with local error:

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

rewrite15.0ms

Algorithm
rewrite-expression-head
Counts
1 → 63
Calls

1 calls. Slowest were:

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

series97.0ms

Counts
1 → 3
Calls

1 calls. Slowest were:

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

simplify1.3s

Counts
81 → 66
Calls

81 calls. Slowest were:

231.0ms
(- (- (* f f) (* n n)))
216.0ms
(/ (* (* (- (+ f n)) (- (+ f n))) (- (+ f n))) (* (* (- f n) (- f n)) (- f n)))
52.0ms
(/ (- (* (cbrt (+ f n)) (cbrt (+ f n)))) 1)

prune508.0ms

Pruning

3 alts after pruning (3 fresh and 0 done)

Merged error: 0b

localize5.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 → 62
Calls

2 calls. Slowest were:

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

series100.0ms

Counts
2 → 6
Calls

2 calls. Slowest were:

55.0ms
(/ (- f n) (+ f n))
45.0ms
(/ -1 (/ (- f n) (+ f n)))

simplify936.0ms

Counts
52 → 68
Calls

52 calls. Slowest were:

432.0ms
(/ (* (* (- f n) (- f n)) (- f n)) (* (* (+ f n) (+ f n)) (+ f n)))
102.0ms
(+ (* f f) (- (* n n) (* f n)))
61.0ms
(+ (* f f) (- (* n n) (* f n)))

prune660.0ms

Pruning

3 alts after pruning (2 fresh and 1 done)

Merged error: 0b

localize7.0ms

Local error

Found 3 expressions with local error:

0.5b
(expm1 (/ (- (+ f n)) (- f n)))
0.0b
(/ (- (+ f n)) (- f n))
0.0b
(log1p (expm1 (/ (- (+ f n)) (- f n))))

rewrite6.0ms

Algorithm
rewrite-expression-head
Counts
3 → 85
Calls

3 calls. Slowest were:

4.0ms
(/ (- (+ f n)) (- f n))
0.0ms
(expm1 (/ (- (+ f n)) (- f n)))
0.0ms
(log1p (expm1 (/ (- (+ f n)) (- f n))))

series227.0ms

Counts
3 → 9
Calls

3 calls. Slowest were:

97.0ms
(log1p (expm1 (/ (- (+ f n)) (- f n))))
79.0ms
(expm1 (/ (- (+ f n)) (- f n)))
50.0ms
(/ (- (+ f n)) (- f n))

simplify1.6s

Counts
89 → 94
Calls

89 calls. Slowest were:

377.0ms
(/ (sqrt (- (+ f n))) (sqrt (- f n)))
273.0ms
(- (- (* f f) (* n n)))
93.0ms
(/ (* (* (- (+ f n)) (- (+ f n))) (- (+ f n))) (* (* (- f n) (- f n)) (- f n)))

prune976.0ms

Pruning

3 alts after pruning (1 fresh and 2 done)

Merged error: 0b

localize49.0ms

Local error

Found 4 expressions with local error:

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

rewrite21.0ms

Algorithm
rewrite-expression-head
Counts
4 → 83
Calls

4 calls. Slowest were:

11.0ms
(* (cbrt (+ n f)) (cbrt (+ n f)))
6.0ms
(cbrt (+ n f))
1.0ms
(cbrt (+ f n))

series642.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

184.0ms
(* (cbrt (+ n f)) (cbrt (+ n f)))
171.0ms
(cbrt (+ n f))
144.0ms
(cbrt (+ n f))
143.0ms
(cbrt (+ f n))

simplify2.2s

Counts
59 → 95
Calls

59 calls. Slowest were:

267.0ms
(- (+ (* 1/3 (* n (pow (/ 1 (pow f 2)) 1/3))) (pow f 1/3)) (* 1/9 (* (pow n 2) (pow (/ 1 (pow f 5)) 1/3))))
259.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))))
232.0ms
(- (+ (pow f 2/3) (* 2/3 (* n (pow (/ 1 f) 1/3)))) (* 1/9 (* (pow n 2) (pow (/ 1 (pow f 4)) 1/3))))

prune1.2s

Pruning

3 alts after pruning (0 fresh and 3 done)

Merged error: 0b

regimes107.0ms

Accuracy

0% (0.0b remaining)

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

bsearch2.0ms