Average Error: 45.3 → 8.3
Time: 11.6s
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.3
Target0
Herbie8.3
\[-1\]

Derivation

  1. Initial program 45.3

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

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

    \[\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-log47.6

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

    \[\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.9

    \[\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.3

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

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

Reproduce

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

  :herbie-target
  -1

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

Details

Time bar (total: 10.7s)Debug log

sample131.0ms

Algorithm
intervals

simplify308.0ms

Counts
1 → 1
Calls

1 calls. Slowest were:

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

prune8.0ms

Pruning

1 alts after pruning (1 fresh and 0 done)

Merged error: 42.8b

localize16.0ms

Local error

Found 2 expressions with local error:

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

rewrite9.0ms

Algorithm
rewrite-expression-head
Counts
2 → 25
Calls

2 calls. Slowest were:

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

series65.0ms

Counts
2 → 6
Calls

2 calls. Slowest were:

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

simplify1.3s

Counts
11 → 31
Calls

11 calls. Slowest were:

308.0ms
(- (fma x y z) (+ z (+ 1 (* x y))))
289.0ms
(/ (exp (fma x y z)) (exp (+ 1 (+ (* x y) z))))
250.0ms
(- (fma x y z) (+ z (+ 1 (* x y))))

prune327.0ms

Pruning

8 alts after pruning (8 fresh and 0 done)

Merged error: 28.3b

localize27.0ms

Local error

Found 2 expressions with local error:

8.7b
(+ (- -1 (* x y)) (- (fma x y z) z))
2.1b
(- (fma x y z) z)

rewrite22.0ms

Algorithm
rewrite-expression-head
Counts
2 → 33
Calls

2 calls. Slowest were:

16.0ms
(+ (- -1 (* x y)) (- (fma x y z) z))
5.0ms
(- (fma x y z) z)

series61.0ms

Counts
2 → 6
Calls

2 calls. Slowest were:

41.0ms
(+ (- -1 (* x y)) (- (fma x y z) z))
19.0ms
(- (fma x y z) z)

simplify2.6s

Counts
18 → 39
Calls

18 calls. Slowest were:

395.0ms
(+ (- -1 (* x y)) (- (fma x y z) z))
283.0ms
(- (fma x y z) (+ z (+ 1 (* x y))))
272.0ms
(- (fma x y z) (+ z (+ 1 (* x y))))

prune540.0ms

Pruning

7 alts after pruning (7 fresh and 0 done)

Merged error: 13.9b

localize24.0ms

Local error

Found 2 expressions with local error:

8.2b
(- (* x y) (- (fma x y z) z))
2.1b
(- (fma x y z) z)

rewrite15.0ms

Algorithm
rewrite-expression-head
Counts
2 → 26
Calls

2 calls. Slowest were:

8.0ms
(- (* x y) (- (fma x y z) z))
6.0ms
(- (fma x y z) z)

series55.0ms

Counts
2 → 6
Calls

2 calls. Slowest were:

34.0ms
(- (* x y) (- (fma x y z) z))
22.0ms
(- (fma x y z) z)

simplify198.0ms

Counts
9 → 32
Calls

9 calls. Slowest were:

90.0ms
(/ (exp (* x y)) (exp (- (fma x y z) z)))
38.0ms
(- (+ z (* x y)) (fma x y z))
36.0ms
(- (+ z (* x y)) (fma x y z))

prune446.0ms

Pruning

2 alts after pruning (2 fresh and 0 done)

Merged error: 7.4b

localize28.0ms

Local error

Found 2 expressions with local error:

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

series58.0ms

Counts
2 → 6
Calls

2 calls. Slowest were:

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

simplify144.0ms

Counts
10 → 31
Calls

10 calls. Slowest were:

48.0ms
(/ (exp (+ z (* x y))) (exp (fma x y z)))
34.0ms
(- (+ z (* x y)) (fma x y z))
22.0ms
(- (+ z (* x y)) (fma x y z))

prune416.0ms

Pruning

2 alts after pruning (1 fresh and 1 done)

Merged error: 7.3b

regimes159.0ms

Accuracy

0% (0.1b remaining)

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

bsearch3.0ms

end0.0ms

sample3.7s

Algorithm
intervals