Average Error: 0.0 → 0.0
Time: 19.2s
Precision: 64
Internal Precision: 128
\[\frac{-\left(f + n\right)}{f - n}\]
\[\log_* (1 + (e^{\frac{-1}{\frac{f - n}{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. Using strategy rm
  5. Applied neg-mul-10.0

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

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

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

Reproduce

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

Details

Time bar (total: 18.8s)Debug log

sample192.0ms

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

simplify39.0ms

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

prune6.0ms

Pruning

1 alts after pruning (1 fresh and 0 done)

Merged error: 0.0b

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

series57.0ms

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

simplify1.2s

Counts
81 → 66
Calls
81 calls:
Slowest
216.0ms
(- (- (* f f) (* n n)))
111.0ms
(/ (* (* (- (+ f n)) (- (+ f n))) (- (+ f n))) (* (* (- f n) (- f n)) (- f n)))
71.0ms
(/ (- (* (cbrt (+ f n)) (cbrt (+ f n)))) (* (cbrt (- f n)) (cbrt (- f n))))
47.0ms
(/ (- (* (cbrt (+ f n)) (cbrt (+ f n)))) 1)
36.0ms
(/ (* (cbrt (- (+ f n))) (cbrt (- (+ f n)))) (* (cbrt (- f n)) (cbrt (- f n))))

prune591.0ms

Pruning

3 alts after pruning (3 fresh and 0 done)

Merged error: 0.0b

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

rewrite12.0ms

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

series203.0ms

Counts
3 → 9
Calls
3 calls:
Slowest
93.0ms
(expm1 (/ (- (+ f n)) (- f n)))
66.0ms
(log1p (expm1 (/ (- (+ f n)) (- f n))))
44.0ms
(/ (- (+ f n)) (- f n))

simplify1.6s

Counts
89 → 94
Calls
89 calls:
Slowest
372.0ms
(/ (sqrt (- (+ f n))) (cbrt (- f n)))
224.0ms
(- (- (* f f) (* n n)))
104.0ms
(/ (* (* (- (+ f n)) (- (+ f n))) (- (+ f n))) (* (* (- f n) (- f n)) (- f n)))
69.0ms
(/ (- (* (cbrt (+ f n)) (cbrt (+ f n)))) (* (cbrt (- f n)) (cbrt (- f n))))
41.0ms
(/ (* (cbrt (- (+ f n))) (cbrt (- (+ f n)))) (* (cbrt (- f n)) (cbrt (- f n))))

prune989.0ms

Pruning

3 alts after pruning (3 fresh and 0 done)

Merged error: 0b

localize13.0ms

Local error

Found 4 expressions with local error:

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

rewrite5.0ms

Algorithm
rewrite-expression-head
Rules
19×add-cube-cbrt
19×*-un-lft-identity
19×add-sqr-sqrt
18×times-frac
18×associate-/r*
add-exp-log
add-cbrt-cube
log1p-expm1-u
associate-/r/
add-log-exp
pow1
expm1-log1p-u
associate-/l*
div-inv
associate-/l/
flip-+
flip3-+
frac-2neg
clear-num
expm1-udef
flip--
log1p-expm1
div-exp
div-sub
flip3--
expm1-log1p
log1p-udef
cbrt-undiv
Counts
4 → 84
Calls
4 calls:
Slowest
3.0ms
(/ (- f n) (+ f n))
1.0ms
(/ -1 (/ (- f n) (+ f n)))
0.0ms
(expm1 (/ -1 (/ (- f n) (+ f n))))
0.0ms
(log1p (expm1 (/ -1 (/ (- f n) (+ f n)))))

series262.0ms

Counts
4 → 12
Calls
4 calls:
Slowest
106.0ms
(expm1 (/ -1 (/ (- f n) (+ f n))))
56.0ms
(log1p (expm1 (/ -1 (/ (- f n) (+ f n)))))
53.0ms
(/ -1 (/ (- f n) (+ f n)))
47.0ms
(/ (- f n) (+ f n))

simplify941.0ms

Counts
59 → 96
Calls
59 calls:
Slowest
304.0ms
(/ (* (* (- f n) (- f n)) (- f n)) (* (* (+ f n) (+ f n)) (+ f n)))
85.0ms
(+ (* f f) (- (* n n) (* f n)))
70.0ms
(/ -1 (/ (- f n) (+ f n)))
69.0ms
(+ (* f f) (- (* n n) (* f n)))
38.0ms
(/ (* (cbrt (- f n)) (cbrt (- f n))) 1)

prune885.0ms

Pruning

3 alts after pruning (2 fresh and 1 done)

Merged error: 0b

localize17.0ms

Local error

Found 4 expressions with local error:

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

rewrite54.0ms

Algorithm
rewrite-expression-head
Rules
150×times-frac
113×add-cube-cbrt
113×*-un-lft-identity
113×add-sqr-sqrt
54×distribute-rgt-neg-in
54×distribute-lft-neg-in
36×associate-*l*
36×associate-*r*
30×associate-/l*
22×add-exp-log
22×add-cbrt-cube
18×neg-mul-1
10×associate-/r/
associate-/r*
pow1
distribute-frac-neg
div-exp
cbrt-undiv
associate-/l/
distribute-neg-frac
flip--
div-inv
flip3--
add-log-exp
log1p-expm1-u
cbrt-unprod
prod-exp
expm1-log1p-u
flip-+
div-sub
flip3-+
frac-2neg
clear-num
neg-sub0
distribute-rgt-neg-out
pow-prod-up
*-commutative
associate-*r/
associate-*l/
pow-prod-down
sqr-neg
pow-plus
frac-times
pow2
distribute-lft-neg-out
Counts
4 → 289
Calls
4 calls:
Slowest
19.0ms
(* (/ (- (+ f n)) (- f n)) (/ (- (+ f n)) (- f n)))
9.0ms
(/ (- (+ f n)) (- f n))
9.0ms
(/ (- (+ f n)) (- f n))
9.0ms
(/ (- (+ f n)) (- f n))

series165.0ms

Counts
4 → 12
Calls
4 calls:
Slowest
49.0ms
(* (/ (- (+ f n)) (- f n)) (/ (- (+ f n)) (- f n)))
44.0ms
(/ (- (+ f n)) (- f n))
36.0ms
(/ (- (+ f n)) (- f n))
35.0ms
(/ (- (+ f n)) (- f n))

simplify7.4s

Counts
336 → 301
Calls
336 calls:
Slowest
391.0ms
(* (- (+ f n)) (- (+ f n)))
305.0ms
(* (/ (- (+ f n)) (- f n)) (/ (- (+ f n)) (- f n)))
288.0ms
(* (/ (+ f n) (- f n)) (/ (- (+ f n)) (- f n)))
284.0ms
(- (- (* f f) (* n n)))
267.0ms
(* (/ (* (* (- (+ f n)) (- (+ f n))) (- (+ f n))) (* (* (- f n) (- f n)) (- f n))) (* (* (/ (- (+ f n)) (- f n)) (/ (- (+ f n)) (- f n))) (/ (- (+ f n)) (- f n))))

prune3.1s

Pruning

3 alts after pruning (1 fresh and 2 done)

Merged error: 0b

regimes117.0ms

Accuracy

0% (0.0b remaining)

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

bsearch2.0ms

end0.0ms

sample858.0ms

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