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

Error

Bits error versus x

Bits error versus y

Bits error versus z

Target

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

Derivation

  1. Initial program 45.1

    \[(x \cdot y + z)_* - \left(1 + \left(x \cdot y + z\right)\right)\]
  2. Initial simplification34.4

    \[\leadsto \left((x \cdot y + z)_* - x \cdot y\right) - \left(z - -1\right)\]
  3. Using strategy rm
  4. Applied sub-neg34.4

    \[\leadsto \left((x \cdot y + z)_* - x \cdot y\right) - \color{blue}{\left(z + \left(--1\right)\right)}\]
  5. Applied associate--r+13.4

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

    \[\leadsto \left(\left((x \cdot y + z)_* - x \cdot y\right) - z\right) - \color{blue}{1}\]
  7. Using strategy rm
  8. Applied flip--31.8

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

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

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

Reproduce

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

  :herbie-target
  -1

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

Details

Time bar (total: 12.6s)Debug log

start121.0ms

Algorithm
intervals

setup294.0ms

Pruning

2 alts after pruning (2 fresh and 0 done)

Merged error: 32.5b

localize32.0ms

Local error

Found 2 expressions with local error:

9.2b
(- (fma x y z) (* x y))
0.5b
(- (- (fma x y z) (* x y)) (- z -1))

rewrite37.0ms

Algorithm
rewrite-expression-head
Counts
2 → 37
Calls

2 calls. Slowest were:

30.0ms
(- (- (fma x y z) (* x y)) (- z -1))
7.0ms
(- (fma x y z) (* x y))

series46.0ms

Counts
2 → 6
Calls

2 calls. Slowest were:

24.0ms
(- (- (fma x y z) (* x y)) (- z -1))
21.0ms
(- (fma x y z) (* x y))

simplify3.1s

Counts
25 → 43
Calls

25 calls. Slowest were:

371.0ms
(/ (/ (exp (fma x y z)) (exp (* x y))) (exp (- z -1)))
331.0ms
(- (fma x y z) (+ z (+ 1 (* x y))))
328.0ms
(* (+ (* (fma x y z) (fma x y z)) (+ (* (* x y) (* x y)) (* (fma x y z) (* x y)))) (+ z -1))

prune502.0ms

Pruning

6 alts after pruning (6 fresh and 0 done)

Merged error: 11.9b

localize11.0ms

Local error

Found 1 expressions with local error:

9.2b
(- (fma x y z) (* x y))

rewrite6.0ms

Algorithm
rewrite-expression-head
Counts
1 → 12
Calls

1 calls. Slowest were:

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

series28.0ms

Counts
1 → 3
Calls

1 calls. Slowest were:

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

simplify53.0ms

Counts
4 → 15
Calls

4 calls. Slowest were:

25.0ms
(/ (exp (fma x y z)) (exp (* x y)))
9.0ms
(- (fma x y z) (* x y))
9.0ms
(- (fma x y z) (* x y))

prune212.0ms

Pruning

6 alts after pruning (5 fresh and 1 done)

Merged error: 11.9b

localize35.0ms

Local error

Found 4 expressions with local error:

16.2b
(- (* (fma x y z) (fma x y z)) (* (* x y) (* x y)))
14.2b
(/ (- (* (fma x y z) (fma x y z)) (* (* x y) (* x y))) (+ (fma x y z) (* x y)))
3.9b
(- (/ (- (* (fma x y z) (fma x y z)) (* (* x y) (* x y))) (+ (fma x y z) (* x y))) z)
0.2b
(* (* x y) (* x y))

rewrite89.0ms

Algorithm
rewrite-expression-head
Counts
4 → 77
Calls

4 calls. Slowest were:

43.0ms
(- (/ (- (* (fma x y z) (fma x y z)) (* (* x y) (* x y))) (+ (fma x y z) (* x y))) z)
27.0ms
(/ (- (* (fma x y z) (fma x y z)) (* (* x y) (* x y))) (+ (fma x y z) (* x y)))
15.0ms
(- (* (fma x y z) (fma x y z)) (* (* x y) (* x y)))

series191.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

94.0ms
(- (/ (- (* (fma x y z) (fma x y z)) (* (* x y) (* x y))) (+ (fma x y z) (* x y))) z)
42.0ms
(/ (- (* (fma x y z) (fma x y z)) (* (* x y) (* x y))) (+ (fma x y z) (* x y)))
30.0ms
(* (* x y) (* x y))
25.0ms
(- (* (fma x y z) (fma x y z)) (* (* x y) (* x y)))

simplify6.0s

Counts
59 → 89
Calls

59 calls. Slowest were:

739.0ms
(* (* (* (* x y) (* x y)) (* x y)) (* (* (* x y) (* x y)) (* x y)))
429.0ms
(- (pow (* (fma x y z) (fma x y z)) 3) (pow (* (* x y) (* x y)) 3))
251.0ms
(/ (cbrt (- (* (fma x y z) (fma x y z)) (* (* x y) (* x y)))) (+ (fma x y z) (* x y)))

prune959.0ms

Pruning

1 alts after pruning (1 fresh and 0 done)

Merged error: 6.5b

localize8.0ms

Local error

Found 2 expressions with local error:

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

rewrite5.0ms

Algorithm
rewrite-expression-head
Counts
2 → 25
Calls

2 calls. Slowest were:

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

series57.0ms

Counts
2 → 6
Calls

2 calls. Slowest were:

38.0ms
(- (fma x y z) (+ z (* x y)))
19.0ms
(+ z (* x y))

simplify243.0ms

Counts
11 → 31
Calls

11 calls. Slowest were:

57.0ms
(/ (exp (fma x y z)) (exp (+ z (* x y))))
56.0ms
(- (fma x y z) (+ z (* x y)))
54.0ms
(- (fma x y z) (+ z (* x y)))

prune338.0ms

Pruning

2 alts after pruning (1 fresh and 1 done)

Merged error: 6.4b

regimes156.0ms

Accuracy

0% (0.1b remaining)

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

bsearch1.0ms