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

Error

Bits error versus x

Bits error versus y

Bits error versus z

Target

Original44.6
Target0
Herbie13.4
\[-1\]

Derivation

  1. Initial program 44.6

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

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

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

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

Reproduce

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

  :herbie-target
  -1

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

Details

Time bar (total: 17.1s)Debug log

start143.0ms

Algorithm
intervals

setup243.0ms

Pruning

2 alts after pruning (2 fresh and 0 done)

Merged error: 31.9b

localize34.0ms

Local error

Found 2 expressions with local error:

7.5b
(- (* x y) (fma x y z))
0.7b
(- (- -1 z) (- (* x y) (fma x y z)))

rewrite20.0ms

Algorithm
rewrite-expression-head
Counts
2 → 37
Calls

2 calls. Slowest were:

14.0ms
(- (- -1 z) (- (* x y) (fma x y z)))
5.0ms
(- (* x y) (fma x y z))

series78.0ms

Counts
2 → 6
Calls

2 calls. Slowest were:

42.0ms
(- (- -1 z) (- (* x y) (fma x y z)))
36.0ms
(- (* x y) (fma x y z))

simplify3.4s

Counts
23 → 43
Calls

23 calls. Slowest were:

579.0ms
(- (* (- (* -1 -1) (* z z)) (+ (* x y) (fma x y z))) (* (+ -1 z) (- (* (* x y) (* x y)) (* (fma x y z) (fma x y z)))))
417.0ms
(/ (exp (- -1 z)) (exp (- (* x y) (fma x y z))))
353.0ms
(* (+ -1 z) (+ (* (* x y) (* x y)) (+ (* (fma x y z) (fma x y z)) (* (* x y) (fma x y z)))))

prune447.0ms

Pruning

4 alts after pruning (4 fresh and 0 done)

Merged error: 10.2b

localize11.0ms

Local error

Found 1 expressions with local error:

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

rewrite5.0ms

Algorithm
rewrite-expression-head
Counts
1 → 12
Calls

1 calls. Slowest were:

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

series25.0ms

Counts
1 → 3
Calls

1 calls. Slowest were:

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

simplify29.0ms

Counts
4 → 15
Calls

4 calls. Slowest were:

16.0ms
(/ (exp (* x y)) (exp (fma x y z)))
4.0ms
(- (* x y) (fma x y z))
4.0ms
(- (* x y) (fma x y z))

prune158.0ms

Pruning

4 alts after pruning (3 fresh and 1 done)

Merged error: 10.2b

localize14.0ms

Local error

Found 4 expressions with local error:

7.8b
(+ (- (fma x y z) z) (- -1 (* x y)))
2.1b
(- (fma x y z) z)
0.0b
(exp (+ (- (fma x y z) z) (- -1 (* x y))))
0.0b
(log (exp (+ (- (fma x y z) z) (- -1 (* x y)))))

rewrite114.0ms

Algorithm
rewrite-expression-head
Counts
4 → 68
Calls

4 calls. Slowest were:

50.0ms
(log (exp (+ (- (fma x y z) z) (- -1 (* x y)))))
48.0ms
(exp (+ (- (fma x y z) z) (- -1 (* x y))))
12.0ms
(+ (- (fma x y z) z) (- -1 (* x y)))

series119.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

35.0ms
(log (exp (+ (- (fma x y z) z) (- -1 (* x y)))))
33.0ms
(+ (- (fma x y z) z) (- -1 (* x y)))
28.0ms
(exp (+ (- (fma x y z) z) (- -1 (* x y))))
23.0ms
(- (fma x y z) z)

simplify6.8s

Counts
48 → 80
Calls

48 calls. Slowest were:

443.0ms
(exp (- (fma x y z) (+ z (+ 1 (* x y)))))
421.0ms
(* (exp (- (fma x y z) z)) (exp (- -1 (* x y))))
419.0ms
(exp (- (fma x y z) (+ z (+ 1 (* x y)))))

prune904.0ms

Pruning

4 alts after pruning (2 fresh and 2 done)

Merged error: 10.2b

localize16.0ms

Local error

Found 4 expressions with local error:

7.5b
(- (* x y) (fma x y z))
7.5b
(- (* x y) (fma x y z))
7.5b
(- (* x y) (fma x y z))
0.7b
(- (- -1 z) (- (* x y) (fma x y z)))

rewrite31.0ms

Algorithm
rewrite-expression-head
Counts
4 → 61
Calls

4 calls. Slowest were:

13.0ms
(- (- -1 z) (- (* x y) (fma x y z)))
8.0ms
(- (* x y) (fma x y z))
4.0ms
(- (* x y) (fma x y z))

series101.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

40.0ms
(- (- -1 z) (- (* x y) (fma x y z)))
27.0ms
(- (* x y) (fma x y z))
18.0ms
(- (* x y) (fma x y z))
16.0ms
(- (* x y) (fma x y z))

simplify3.2s

Counts
31 → 73
Calls

31 calls. Slowest were:

513.0ms
(- (* (- (* -1 -1) (* z z)) (+ (* x y) (fma x y z))) (* (+ -1 z) (- (* (* x y) (* x y)) (* (fma x y z) (fma x y z)))))
405.0ms
(/ (exp (- -1 z)) (exp (- (* x y) (fma x y z))))
372.0ms
(/ (exp (- -1 z)) (/ (exp (* x y)) (exp (fma x y z))))

prune1.0s

Pruning

5 alts after pruning (2 fresh and 3 done)

Merged error: 10.2b

regimes214.0ms

Accuracy

0% (0.2b remaining)

Error of 13.4b against oracle of 13.2b and baseline of 13.4b

bsearch2.0ms