Average Error: 44.9 → 7.7
Time: 23.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

Original44.9
Target0
Herbie7.7
\[-1\]

Derivation

  1. Initial program 44.9

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

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

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

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

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

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

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

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

Reproduce

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

  :herbie-target
  -1

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

Details

Time bar (total: 23.0s)Debug log

sample122.0ms

Algorithm
intervals

simplify256.0ms

Counts
1 → 1
Calls

1 calls. Slowest were:

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

prune6.0ms

Pruning

1 alts after pruning (1 fresh and 0 done)

Merged error: 46.4b

localize15.0ms

Local error

Found 2 expressions with local error:

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

rewrite18.0ms

Algorithm
rewrite-expression-head
Counts
2 → 26
Calls

2 calls. Slowest were:

9.0ms
(+ 1 (+ (* x y) z))
8.0ms
(- (fma x y z) (+ 1 (+ (* x y) z)))

series52.0ms

Counts
2 → 6
Calls

2 calls. Slowest were:

27.0ms
(- (fma x y z) (+ 1 (+ (* x y) z)))
24.0ms
(+ 1 (+ (* x y) z))

simplify1.9s

Counts
11 → 32
Calls

11 calls. Slowest were:

621.0ms
(/ (exp (fma x y z)) (exp (+ 1 (+ (* x y) z))))
382.0ms
(- (fma x y z) (+ z (+ 1 (* x y))))
344.0ms
(- (fma x y z) (+ z (+ 1 (* x y))))

prune326.0ms

Pruning

8 alts after pruning (8 fresh and 0 done)

Merged error: 30.4b

localize27.0ms

Local error

Found 4 expressions with local error:

8.7b
(+ (- -1 (* x y)) (- (fma x y z) z))
2.5b
(- (fma x y z) z)
0.2b
(log (exp (+ (- -1 (* x y)) (- (fma x y z) z))))
0.0b
(exp (+ (- -1 (* x y)) (- (fma x y z) z)))

rewrite83.0ms

Algorithm
rewrite-expression-head
Counts
4 → 68
Calls

4 calls. Slowest were:

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

series111.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

40.0ms
(+ (- -1 (* x y)) (- (fma x y z) z))
35.0ms
(exp (+ (- -1 (* x y)) (- (fma x y z) z)))
24.0ms
(log (exp (+ (- -1 (* x y)) (- (fma x y z) z))))
13.0ms
(- (fma x y z) z)

simplify9.1s

Counts
44 → 80
Calls

44 calls. Slowest were:

577.0ms
(+ (- -1 (* x y)) (- (fma x y z) z))
535.0ms
(exp (* (cbrt (+ (- -1 (* x y)) (- (fma x y z) z))) (cbrt (+ (- -1 (* x y)) (- (fma x y z) z)))))
534.0ms
(exp (sqrt (+ (- -1 (* x y)) (- (fma x y z) z))))

prune976.0ms

Pruning

7 alts after pruning (7 fresh and 0 done)

Merged error: 13.4b

localize23.0ms

Local error

Found 4 expressions with local error:

8.6b
(- (* x y) (- (fma x y z) z))
2.5b
(- (fma x y z) z)
0.2b
(log (exp (- -1 (- (* x y) (- (fma x y z) z)))))
0.0b
(exp (- -1 (- (* x y) (- (fma x y z) z))))

rewrite21.0ms

Algorithm
rewrite-expression-head
Counts
4 → 60
Calls

4 calls. Slowest were:

9.0ms
(- (* x y) (- (fma x y z) z))
5.0ms
(- (fma x y z) z)
3.0ms
(log (exp (- -1 (- (* x y) (- (fma x y z) z)))))

series90.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

27.0ms
(- (* x y) (- (fma x y z) z))
25.0ms
(exp (- -1 (- (* x y) (- (fma x y z) z))))
23.0ms
(log (exp (- -1 (- (* x y) (- (fma x y z) z)))))
14.0ms
(- (fma x y z) z)

simplify5.0s

Counts
33 → 72
Calls

33 calls. Slowest were:

501.0ms
(- -1 (- (* x y) (- (fma x y z) z)))
430.0ms
(cbrt (- -1 (- (* x y) (- (fma x y z) z))))
414.0ms
(exp (sqrt (- -1 (- (* x y) (- (fma x y z) z)))))

prune752.0ms

Pruning

1 alts after pruning (1 fresh and 0 done)

Merged error: 6.7b

localize25.0ms

Local error

Found 1 expressions with local error:

6.6b
(- (+ z (* x y)) (fma x y z))

rewrite7.0ms

Algorithm
rewrite-expression-head
Counts
1 → 15
Calls

1 calls. Slowest were:

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

series21.0ms

Counts
1 → 3
Calls

1 calls. Slowest were:

20.0ms
(- (+ z (* x y)) (fma x y z))

simplify179.0ms

Counts
7 → 18
Calls

7 calls. Slowest were:

75.0ms
(/ (exp (+ z (* x y))) (exp (fma x y z)))
37.0ms
(- (+ z (* x y)) (fma x y z))
26.0ms
(- (+ z (* x y)) (fma x y z))

prune226.0ms

Pruning

2 alts after pruning (1 fresh and 1 done)

Merged error: 6.6b

regimes125.0ms

Accuracy

0% (0.1b remaining)

Error of 7.7b against oracle of 7.6b and baseline of 7.7b

bsearch1.0ms

end0.0ms

sample3.6s

Algorithm
intervals