Average Error: 0.0 → 0.0
Time: 12.3s
Precision: 64
Internal Precision: 128
\[\left(d1 \cdot d2 + \left(d3 + 5\right) \cdot d1\right) + d1 \cdot 32\]
\[(d1 \cdot \left(37 + d2\right) + \left(d3 \cdot d1\right))_*\]

Error

Bits error versus d1

Bits error versus d2

Bits error versus d3

Target

Original0.0
Target0.0
Herbie0.0
\[d1 \cdot \left(\left(37 + d3\right) + d2\right)\]

Derivation

  1. Initial program 0.0

    \[\left(d1 \cdot d2 + \left(d3 + 5\right) \cdot d1\right) + d1 \cdot 32\]
  2. Simplified0.0

    \[\leadsto \color{blue}{(\left(d2 + d3\right) \cdot d1 + \left(d1 \cdot 37\right))_*}\]
  3. Taylor expanded around -inf 0.0

    \[\leadsto \color{blue}{d2 \cdot d1 + \left(d3 \cdot d1 + 37 \cdot d1\right)}\]
  4. Simplified0.0

    \[\leadsto \color{blue}{(d1 \cdot \left(37 + d2\right) + \left(d3 \cdot d1\right))_*}\]
  5. Final simplification0.0

    \[\leadsto (d1 \cdot \left(37 + d2\right) + \left(d3 \cdot d1\right))_*\]

Reproduce

herbie shell --seed 2019022 +o rules:numerics
(FPCore (d1 d2 d3)
  :name "FastMath dist3"

  :herbie-target
  (* d1 (+ (+ 37 d3) d2))

  (+ (+ (* d1 d2) (* (+ d3 5) d1)) (* d1 32)))

Details

Time bar (total: 12.0s)Debug log

sample30.0ms

Algorithm
intervals
Results
21.0ms333×body80valid

simplify374.0ms

Counts
1 → 1
Calls
1 calls:
Slowest
374.0ms
(+ (+ (* d1 d2) (* (+ d3 5) d1)) (* d1 32))

prune18.0ms

Pruning

2 alts after pruning (2 fresh and 0 done)

Merged error: 0.0b

localize17.0ms

Local error

Found 1 expressions with local error:

0.0b
(fma (+ d2 d3) d1 (* d1 37))

rewrite1.0ms

Algorithm
rewrite-expression-head
Rules
add-log-exp
log1p-expm1-u
fma-udef
add-cube-cbrt
add-exp-log
add-cbrt-cube
*-un-lft-identity
pow1
expm1-log1p-u
add-sqr-sqrt
Counts
1 → 10
Calls
1 calls:
Slowest
0.0ms
(fma (+ d2 d3) d1 (* d1 37))

series27.0ms

Counts
1 → 3
Calls
1 calls:
Slowest
27.0ms
(fma (+ d2 d3) d1 (* d1 37))

simplify177.0ms

Counts
3 → 13
Calls
3 calls:
Slowest
64.0ms
(+ (* d2 d1) (+ (* d3 d1) (* 37 d1)))
57.0ms
(+ (* d2 d1) (+ (* d3 d1) (* 37 d1)))
56.0ms
(+ (* d2 d1) (+ (* d3 d1) (* 37 d1)))

prune127.0ms

Pruning

4 alts after pruning (3 fresh and 1 done)

Merged error: 0b

localize11.0ms

Local error

Found 1 expressions with local error:

0.0b
(fma d1 (+ 37 d2) (* d3 d1))

rewrite0.0ms

Algorithm
rewrite-expression-head
Rules
add-log-exp
log1p-expm1-u
fma-udef
add-cube-cbrt
add-exp-log
add-cbrt-cube
*-un-lft-identity
pow1
expm1-log1p-u
add-sqr-sqrt
Counts
1 → 10
Calls
1 calls:
Slowest
0.0ms
(fma d1 (+ 37 d2) (* d3 d1))

series19.0ms

Counts
1 → 3
Calls
1 calls:
Slowest
19.0ms
(fma d1 (+ 37 d2) (* d3 d1))

simplify119.0ms

Counts
3 → 13
Calls
3 calls:
Slowest
41.0ms
(+ (* d2 d1) (+ (* d3 d1) (* 37 d1)))
40.0ms
(+ (* d2 d1) (+ (* d3 d1) (* 37 d1)))
38.0ms
(+ (* d2 d1) (+ (* d3 d1) (* 37 d1)))

prune87.0ms

Pruning

4 alts after pruning (2 fresh and 2 done)

Merged error: 0b

localize23.0ms

Local error

Found 3 expressions with local error:

0.0b
(+ (+ (* d1 d2) (* (+ d3 5) d1)) (* d1 32))
0.0b
(+ (* d1 d2) (* (+ d3 5) d1))
0.0b
(* (+ d3 5) d1)

rewrite24.0ms

Algorithm
rewrite-expression-head
Rules
10×add-log-exp
add-cube-cbrt
*-un-lft-identity
add-sqr-sqrt
fma-def
sum-log
log1p-expm1-u
flip-+
add-exp-log
associate-*l*
add-cbrt-cube
flip3-+
pow1
expm1-log1p-u
associate-*l/
+-commutative
*-commutative
associate-+l+
Counts
3 → 47
Calls
3 calls:
Slowest
15.0ms
(+ (+ (* d1 d2) (* (+ d3 5) d1)) (* d1 32))
4.0ms
(+ (* d1 d2) (* (+ d3 5) d1))
4.0ms
(* (+ d3 5) d1)

series64.0ms

Counts
3 → 9
Calls
3 calls:
Slowest
22.0ms
(+ (* d1 d2) (* (+ d3 5) d1))
21.0ms
(+ (+ (* d1 d2) (* (+ d3 5) d1)) (* d1 32))
20.0ms
(* (+ d3 5) d1)

simplify1.1s

Counts
19 → 56
Calls
19 calls:
Slowest
196.0ms
(* (exp (+ (* d1 d2) (* (+ d3 5) d1))) (exp (* d1 32)))
145.0ms
(* (* (exp (* d1 d2)) (exp (* (+ d3 5) d1))) (exp (* d1 32)))
112.0ms
(* (exp (* d1 d2)) (exp (* (+ d3 5) d1)))
110.0ms
(* (- (* d3 d3) (* 5 5)) d1)
77.0ms
(+ (* d2 d1) (+ (* d3 d1) (* 5 d1)))

prune471.0ms

Pruning

3 alts after pruning (1 fresh and 2 done)

Merged error: 0b

localize22.0ms

Local error

Found 4 expressions with local error:

0.5b
(cbrt (+ (* d1 d2) (* (+ d3 5) d1)))
0.5b
(cbrt (+ (* d1 d2) (* (+ d3 5) d1)))
0.5b
(cbrt (+ (* d1 d2) (* (+ d3 5) d1)))
0.5b
(* (cbrt (+ (* d1 d2) (* (+ d3 5) d1))) (cbrt (+ (* d1 d2) (* (+ d3 5) d1))))

rewrite25.0ms

Algorithm
rewrite-expression-head
Rules
18×cbrt-div
15×cbrt-prod
11×add-cube-cbrt
11×*-un-lft-identity
11×add-sqr-sqrt
flip-+
flip3-+
pow1
pow1/3
add-exp-log
associate-*l*
associate-*r*
add-log-exp
log1p-expm1-u
add-cbrt-cube
frac-times
expm1-log1p-u
pow-prod-up
associate-*r/
associate-*l/
pow-prod-down
cbrt-unprod
*-commutative
prod-exp
pow-plus
pow2
Counts
4 → 83
Calls
4 calls:
Slowest
16.0ms
(* (cbrt (+ (* d1 d2) (* (+ d3 5) d1))) (cbrt (+ (* d1 d2) (* (+ d3 5) d1))))
2.0ms
(cbrt (+ (* d1 d2) (* (+ d3 5) d1)))
2.0ms
(cbrt (+ (* d1 d2) (* (+ d3 5) d1)))
2.0ms
(cbrt (+ (* d1 d2) (* (+ d3 5) d1)))

series470.0ms

Counts
4 → 12
Calls
4 calls:
Slowest
137.0ms
(* (cbrt (+ (* d1 d2) (* (+ d3 5) d1))) (cbrt (+ (* d1 d2) (* (+ d3 5) d1))))
118.0ms
(cbrt (+ (* d1 d2) (* (+ d3 5) d1)))
113.0ms
(cbrt (+ (* d1 d2) (* (+ d3 5) d1)))
102.0ms
(cbrt (+ (* d1 d2) (* (+ d3 5) d1)))

simplify6.9s

Counts
59 → 95
Calls
59 calls:
Slowest
556.0ms
(* (+ (* d1 d2) (* (+ d3 5) d1)) (+ (* d1 d2) (* (+ d3 5) d1)))
361.0ms
(cbrt (+ (pow (* d1 d2) 3) (pow (* (+ d3 5) d1) 3)))
310.0ms
(cbrt (+ (pow (* d1 d2) 3) (pow (* (+ d3 5) d1) 3)))
304.0ms
(cbrt (- (* (* d1 d2) (* d1 d2)) (* (* (+ d3 5) d1) (* (+ d3 5) d1))))
299.0ms
(cbrt (+ (pow (* d1 d2) 3) (pow (* (+ d3 5) d1) 3)))

prune816.0ms

Pruning

3 alts after pruning (0 fresh and 3 done)

Merged error: 0b

regimes113.0ms

Accuracy

0% (0.0b remaining)

Error of 0.0b against oracle of 0.0b and baseline of 0.0b

bsearch1.0ms

end0.0ms

sample912.0ms

Algorithm
intervals
Results
716.0ms10070×body80valid
3.0ms16×body640valid
2.0ms13×body320valid
1.0msbody1280valid
1.0msbody160valid