Average Error: 45.9 → 8.2
Time: 16.0s
Precision: 64
Internal Precision: 128
\[(x \cdot y + z)_* - \left(1 + \left(x \cdot y + z\right)\right)\]
\[\log \left(e^{-1 - \left(\left(z + x \cdot y\right) - (x \cdot y + z)_*\right)}\right)\]

Error

Bits error versus x

Bits error versus y

Bits error versus z

Target

Original45.9
Target0
Herbie8.2
\[-1\]

Derivation

  1. Initial program 45.9

    \[(x \cdot y + z)_* - \left(1 + \left(x \cdot y + z\right)\right)\]
  2. Using strategy rm
  3. Applied add-log-exp47.7

    \[\leadsto (x \cdot y + z)_* - \color{blue}{\log \left(e^{1 + \left(x \cdot y + z\right)}\right)}\]
  4. Applied add-log-exp48.2

    \[\leadsto \color{blue}{\log \left(e^{(x \cdot y + z)_*}\right)} - \log \left(e^{1 + \left(x \cdot y + z\right)}\right)\]
  5. Applied diff-log48.2

    \[\leadsto \color{blue}{\log \left(\frac{e^{(x \cdot y + z)_*}}{e^{1 + \left(x \cdot y + z\right)}}\right)}\]
  6. Simplified31.1

    \[\leadsto \log \color{blue}{\left(e^{\left(-1 - x \cdot y\right) + \left((x \cdot y + z)_* - z\right)}\right)}\]
  7. Using strategy rm
  8. Applied associate-+l-14.7

    \[\leadsto \log \left(e^{\color{blue}{-1 - \left(x \cdot y - \left((x \cdot y + z)_* - z\right)\right)}}\right)\]
  9. Taylor expanded around -inf 8.2

    \[\leadsto \log \left(e^{-1 - \color{blue}{\left(\left(z + x \cdot y\right) - (x \cdot y + z)_*\right)}}\right)\]
  10. Final simplification8.2

    \[\leadsto \log \left(e^{-1 - \left(\left(z + x \cdot y\right) - (x \cdot y + z)_*\right)}\right)\]

Reproduce

herbie shell --seed 2019004 
(FPCore (x y z)
  :name "simple fma test"

  :herbie-target
  -1

  (- (fma x y z) (+ 1 (+ (* x y) z))))

Details

Time bar (total: 15.5s)Debug log

sample98.0ms

Algorithm
intervals

simplify274.0ms

Counts
1 → 1
Calls

1 calls. Slowest were:

273.0ms
(- (fma x y z) (+ 1 (+ (* x y) z)))

prune11.0ms

Pruning

1 alts after pruning (1 fresh and 0 done)

Merged error: 45.5b

localize32.0ms

Local error

Found 2 expressions with local error:

11.8b
(- (fma x y z) (+ 1 (+ (* x y) z)))
0.0b
(+ (* x y) z)

rewrite20.0ms

Algorithm
rewrite-expression-head
Counts
2 → 25
Calls

2 calls. Slowest were:

18.0ms
(- (fma x y z) (+ 1 (+ (* x y) z)))
2.0ms
(+ (* x y) z)

series41.0ms

Counts
2 → 6
Calls

2 calls. Slowest were:

26.0ms
(- (fma x y z) (+ 1 (+ (* x y) z)))
15.0ms
(+ (* x y) z)

simplify1.3s

Counts
11 → 31
Calls

11 calls. Slowest were:

322.0ms
(/ (exp (fma x y z)) (exp (+ 1 (+ (* x y) z))))
258.0ms
(- (fma x y z) (+ z (+ 1 (* x y))))
255.0ms
(- (fma x y z) (+ z (+ 1 (* x y))))

prune284.0ms

Pruning

7 alts after pruning (6 fresh and 1 done)

Merged error: 31.3b

localize13.0ms

Local error

Found 3 expressions with local error:

11.4b
(+ (- -1 (* x y)) (- (fma x y z) z))
2.2b
(- (fma x y z) z)
0.0b
(exp (+ (- -1 (* x y)) (- (fma x y z) z)))

rewrite51.0ms

Algorithm
rewrite-expression-head
Counts
3 → 49
Calls

3 calls. Slowest were:

37.0ms
(exp (+ (- -1 (* x y)) (- (fma x y z) z)))
7.0ms
(+ (- -1 (* x y)) (- (fma x y z) z))
6.0ms
(- (fma x y z) z)

series80.0ms

Counts
3 → 9
Calls

3 calls. Slowest were:

42.0ms
(exp (+ (- -1 (* x y)) (- (fma x y z) z)))
24.0ms
(+ (- -1 (* x y)) (- (fma x y z) z))
14.0ms
(- (fma x y z) z)

simplify5.0s

Counts
30 → 58
Calls

30 calls. Slowest were:

550.0ms
(+ (- -1 (* x y)) (- (fma x y z) z))
528.0ms
(+ (- -1 (* x y)) (- (fma x y z) z))
444.0ms
(exp (sqrt (+ (- -1 (* x y)) (- (fma x y z) z))))

prune819.0ms

Pruning

9 alts after pruning (9 fresh and 0 done)

Merged error: 15.9b

localize22.0ms

Local error

Found 3 expressions with local error:

11.0b
(- (* x y) (- (fma x y z) z))
2.2b
(- (fma x y z) z)
0.0b
(exp (- -1 (- (* x y) (- (fma x y z) z))))

rewrite15.0ms

Algorithm
rewrite-expression-head
Counts
3 → 41
Calls

3 calls. Slowest were:

9.0ms
(- (* x y) (- (fma x y z) z))
4.0ms
(- (fma x y z) z)
1.0ms
(exp (- -1 (- (* x y) (- (fma x y z) z))))

series81.0ms

Counts
3 → 9
Calls

3 calls. Slowest were:

43.0ms
(exp (- -1 (- (* x y) (- (fma x y z) z))))
20.0ms
(- (* x y) (- (fma x y z) z))
18.0ms
(- (fma x y z) z)

simplify1.9s

Counts
20 → 50
Calls

20 calls. Slowest were:

362.0ms
(- -1 (- (* x y) (- (fma x y z) z)))
317.0ms
(exp (* (cbrt (- -1 (- (* x y) (- (fma x y z) z)))) (cbrt (- -1 (- (* x y) (- (fma x y z) z))))))
297.0ms
(exp (sqrt (- -1 (- (* x y) (- (fma x y z) z)))))

prune597.0ms

Pruning

1 alts after pruning (1 fresh and 0 done)

Merged error: 9.2b

localize28.0ms

Local error

Found 2 expressions with local error:

9.1b
(- (+ z (* x y)) (fma x y z))
0.0b
(+ z (* x y))

rewrite10.0ms

Algorithm
rewrite-expression-head
Counts
2 → 25
Calls

2 calls. Slowest were:

8.0ms
(- (+ z (* x y)) (fma x y z))
1.0ms
(+ z (* x y))

series61.0ms

Counts
2 → 6
Calls

2 calls. Slowest were:

32.0ms
(- (+ z (* x y)) (fma x y z))
29.0ms
(+ z (* x y))

simplify546.0ms

Counts
10 → 31
Calls

10 calls. Slowest were:

402.0ms
(- (+ z (* x y)) (fma x y z))
64.0ms
(/ (exp (+ z (* x y))) (exp (fma x y z)))
35.0ms
(- (+ z (* x y)) (fma x y z))

prune380.0ms

Pruning

2 alts after pruning (1 fresh and 1 done)

Merged error: 9.0b

regimes120.0ms

Accuracy

0% (0.1b remaining)

Error of 8.2b against oracle of 8.1b and baseline of 8.2b

bsearch1.0ms

end0.0ms

sample3.7s

Algorithm
intervals