Average Error: 45.2 → 8.4
Time: 19.1s
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.2
Target0
Herbie8.4
\[-1\]

Derivation

  1. Initial program 45.2

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

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

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

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

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

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

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

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

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

Reproduce

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

  :herbie-target
  -1

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

Details

Time bar (total: 18.6s)Debug log

sample116.0ms

Algorithm
intervals

simplify268.0ms

Counts
1 → 1
Calls

1 calls. Slowest were:

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

localize31.0ms

Local error

Found 2 expressions with local error:

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

rewrite16.0ms

Algorithm
rewrite-expression-head
Counts
2 → 25
Calls

2 calls. Slowest were:

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

series71.0ms

Counts
2 → 6
Calls

2 calls. Slowest were:

49.0ms
(- (fma x y z) (+ 1 (+ (* x y) z)))
21.0ms
(+ (* x y) z)

simplify1.3s

Counts
11 → 31
Calls

11 calls. Slowest were:

287.0ms
(- (fma x y z) (+ z (+ 1 (* x y))))
271.0ms
(- (fma x y z) (+ 1 (+ (* x y) z)))
269.0ms
(/ (exp (fma x y z)) (exp (+ 1 (+ (* x y) z))))

prune325.0ms

Pruning

7 alts after pruning (7 fresh and 0 done)

Merged error: 29.1b

localize14.0ms

Local error

Found 4 expressions with local error:

9.5b
(+ (- -1 (* x y)) (- (fma x y z) z))
1.8b
(- (fma x y z) z)
0.0b
(exp (+ (- -1 (* x y)) (- (fma x y z) z)))
0.0b
(log (exp (+ (- -1 (* x y)) (- (fma x y z) z))))

rewrite83.0ms

Algorithm
rewrite-expression-head
Counts
4 → 68
Calls

4 calls. Slowest were:

37.0ms
(exp (+ (- -1 (* x y)) (- (fma x y z) z)))
34.0ms
(log (exp (+ (- -1 (* x y)) (- (fma x y z) z))))
8.0ms
(+ (- -1 (* x y)) (- (fma x y z) z))

series90.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

28.0ms
(exp (+ (- -1 (* x y)) (- (fma x y z) z)))
24.0ms
(log (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)

simplify8.6s

Counts
44 → 80
Calls

44 calls. Slowest were:

605.0ms
(+ (- -1 (* x y)) (- (fma x y z) z))
545.0ms
(sqrt (+ (- -1 (* x y)) (- (fma x y z) z)))
524.0ms
(+ (- -1 (* x y)) (- (fma x y z) z))

prune1.2s

Pruning

9 alts after pruning (9 fresh and 0 done)

Merged error: 13.6b

localize13.0ms

Local error

Found 3 expressions with local error:

9.3b
(- (* x y) (- (fma x y z) z))
1.8b
(- (fma x y z) z)
1.3b
(log (exp (- (* x y) (- (fma x y z) z))))

rewrite23.0ms

Algorithm
rewrite-expression-head
Counts
3 → 45
Calls

3 calls. Slowest were:

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

series68.0ms

Counts
3 → 9
Calls

3 calls. Slowest were:

32.0ms
(log (exp (- (* x y) (- (fma x y z) z))))
20.0ms
(- (* x y) (- (fma x y z) z))
16.0ms
(- (fma x y z) z)

simplify664.0ms

Counts
23 → 54
Calls

23 calls. Slowest were:

111.0ms
(log (* (cbrt (exp (- (* x y) (- (fma x y z) z)))) (cbrt (exp (- (* x y) (- (fma x y z) z))))))
104.0ms
(/ (exp (* x y)) (exp (- (fma x y z) z)))
87.0ms
(log (sqrt (exp (- (* x y) (- (fma x y z) z)))))

prune878.0ms

Pruning

2 alts after pruning (2 fresh and 0 done)

Merged error: 7.9b

localize17.0ms

Local error

Found 2 expressions with local error:

7.6b
(- (+ 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:

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

series60.0ms

Counts
2 → 6
Calls

2 calls. Slowest were:

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

simplify223.0ms

Counts
10 → 31
Calls

10 calls. Slowest were:

80.0ms
(/ (exp (+ z (* x y))) (exp (fma x y z)))
37.0ms
(- (+ z (* x y)) (fma x y z))
36.0ms
(- (+ z (* x y)) (fma x y z))

prune353.0ms

Pruning

3 alts after pruning (2 fresh and 1 done)

Merged error: 7.9b

regimes161.0ms

Accuracy

0% (0.1b remaining)

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

bsearch1.0ms

end0.0ms

sample4.0s

Algorithm
intervals