Average Error: 45.0 → 8.1
Time: 15.9s
Precision: 64
Internal Precision: 128
\[(x \cdot y + z)_* - \left(1 + \left(x \cdot y + z\right)\right)\]
\[-1 - \left(\left(z + x \cdot y\right) - (x \cdot y + z)_*\right)\]

Error

Bits error versus x

Bits error versus y

Bits error versus z

Target

Original45.0
Target0
Herbie8.1
\[-1\]

Derivation

  1. Initial program 45.0

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

    \[\leadsto (x \cdot y + z)_* - \color{blue}{\log \left(e^{1 + \left(x \cdot y + z\right)}\right)}\]
  4. Applied add-log-exp47.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-log47.2

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

    \[\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-15.2

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

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

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

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

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

    \[\leadsto -1 - \left(\left(z + x \cdot y\right) - (x \cdot y + z)_*\right)\]

Reproduce

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

  :herbie-target
  -1

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

Details

Time bar (total: 15.4s)Debug log

sample122.0ms

Algorithm
intervals

simplify299.0ms

Counts
1 → 1
Calls

1 calls. Slowest were:

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

prune6.0ms

Pruning

1 alts after pruning (1 fresh and 0 done)

Merged error: 46.1b

localize16.0ms

Local error

Found 2 expressions with local error:

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

rewrite15.0ms

Algorithm
rewrite-expression-head
Counts
2 → 25
Calls

2 calls. Slowest were:

11.0ms
(- (fma x y z) (+ 1 (+ (* x y) z)))
3.0ms
(+ (* x y) z)

series65.0ms

Counts
2 → 6
Calls

2 calls. Slowest were:

42.0ms
(- (fma x y z) (+ 1 (+ (* x y) z)))
23.0ms
(+ (* x y) z)

simplify1.7s

Counts
11 → 31
Calls

11 calls. Slowest were:

600.0ms
(/ (exp (fma x y z)) (exp (+ 1 (+ (* x y) z))))
281.0ms
(- (fma x y z) (+ z (+ 1 (* x y))))
273.0ms
(- (fma x y z) (+ z (+ 1 (* x y))))

prune371.0ms

Pruning

8 alts after pruning (8 fresh and 0 done)

Merged error: 29.3b

localize30.0ms

Local error

Found 3 expressions with local error:

10.1b
(+ (- -1 (* x y)) (- (fma x y z) z))
1.9b
(- (fma x y z) z)
0.5b
(log (exp (+ (- -1 (* x y)) (- (fma x y z) z))))

rewrite68.0ms

Algorithm
rewrite-expression-head
Counts
3 → 52
Calls

3 calls. Slowest were:

46.0ms
(log (exp (+ (- -1 (* x y)) (- (fma x y z) z))))
16.0ms
(+ (- -1 (* x y)) (- (fma x y z) z))
6.0ms
(- (fma x y z) z)

series104.0ms

Counts
3 → 9
Calls

3 calls. Slowest were:

44.0ms
(+ (- -1 (* x y)) (- (fma x y z) z))
40.0ms
(log (exp (+ (- -1 (* x y)) (- (fma x y z) z))))
21.0ms
(- (fma x y z) z)

simplify6.1s

Counts
32 → 61
Calls

32 calls. Slowest were:

629.0ms
(+ (- -1 (* x y)) (- (fma x y z) z))
526.0ms
(cbrt (+ (- -1 (* x y)) (- (fma x y z) z)))
523.0ms
(+ (- -1 (* x y)) (- (fma x y z) z))

prune813.0ms

Pruning

8 alts after pruning (8 fresh and 0 done)

Merged error: 14.2b

localize10.0ms

Local error

Found 3 expressions with local error:

10.1b
(- (* x y) (- (fma x y z) z))
1.9b
(- (fma x y z) z)
0.9b
(log (exp (- (* x y) (- (fma x y z) z))))

rewrite21.0ms

Algorithm
rewrite-expression-head
Counts
3 → 45
Calls

3 calls. Slowest were:

13.0ms
(log (exp (- (* x y) (- (fma x y z) z))))
4.0ms
(- (* x y) (- (fma x y z) z))
3.0ms
(- (fma x y z) z)

series89.0ms

Counts
3 → 9
Calls

3 calls. Slowest were:

33.0ms
(log (exp (- (* x y) (- (fma x y z) z))))
33.0ms
(- (* x y) (- (fma x y z) z))
23.0ms
(- (fma x y z) z)

simplify659.0ms

Counts
23 → 54
Calls

23 calls. Slowest were:

96.0ms
(log (sqrt (exp (- (* x y) (- (fma x y z) z)))))
93.0ms
(/ (exp (* x y)) (exp (- (fma x y z) z)))
76.0ms
(log (* (cbrt (exp (- (* x y) (- (fma x y z) z)))) (cbrt (exp (- (* x y) (- (fma x y z) z))))))

prune639.0ms

Pruning

2 alts after pruning (2 fresh and 0 done)

Merged error: 8.2b

localize8.0ms

Local error

Found 2 expressions with local error:

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

rewrite5.0ms

Algorithm
rewrite-expression-head
Counts
2 → 25
Calls

2 calls. Slowest were:

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

series60.0ms

Counts
2 → 6
Calls

2 calls. Slowest were:

33.0ms
(- (+ z (* x y)) (fma x y z))
27.0ms
(+ z (* x y))

simplify176.0ms

Counts
10 → 31
Calls

10 calls. Slowest were:

75.0ms
(/ (exp (+ z (* x y))) (exp (fma x y z)))
34.0ms
(- (+ z (* x y)) (fma x y z))
20.0ms
(- (+ z (* x y)) (fma x y z))

prune338.0ms

Pruning

3 alts after pruning (2 fresh and 1 done)

Merged error: 8.1b

regimes157.0ms

Accuracy

0% (0.1b remaining)

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

bsearch2.0ms

end0.0ms

sample3.4s

Algorithm
intervals