Average Error: 0.1 → 0.1
Time: 22.5s
Precision: 64
Internal Precision: 128
\[\left(d1 \cdot 3 + d1 \cdot d2\right) + d1 \cdot d3\]
\[d1 \cdot d2 + \left(3 + d3\right) \cdot d1\]

Error

Bits error versus d1

Bits error versus d2

Bits error versus d3

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

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

Derivation

  1. Initial program 0.1

    \[\left(d1 \cdot 3 + d1 \cdot d2\right) + d1 \cdot d3\]
  2. Simplified0.1

    \[\leadsto \color{blue}{d1 \cdot \left(d2 + \left(3 + d3\right)\right)}\]
  3. Using strategy rm
  4. Applied distribute-lft-in0.1

    \[\leadsto \color{blue}{d1 \cdot d2 + d1 \cdot \left(3 + d3\right)}\]
  5. Final simplification0.1

    \[\leadsto d1 \cdot d2 + \left(3 + d3\right) \cdot d1\]

Reproduce

herbie shell --seed 2019018 
(FPCore (d1 d2 d3)
  :name "FastMath test3"

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

  (+ (+ (* d1 3) (* d1 d2)) (* d1 d3)))

Details

Time bar (total: 22.0s)Debug log

sample43.0ms

Algorithm
intervals
Results
24.0ms288×body80valid
3.0msbody640valid
1.0msbody320valid
1.0msbody1280valid
0.0msbody160valid

simplify39.0ms

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

prune18.0ms

Pruning

2 alts after pruning (2 fresh and 0 done)

Merged error: 0.1b

localize19.0ms

Local error

Found 1 expressions with local error:

0.0b
(* d1 (+ d2 (+ 3 d3)))

rewrite3.0ms

Algorithm
rewrite-expression-head
Rules
associate-*r*
add-cube-cbrt
associate-*r/
*-un-lft-identity
add-sqr-sqrt
add-log-exp
flip-+
*-commutative
add-exp-log
add-cbrt-cube
flip3-+
distribute-lft-in
pow1
distribute-rgt-in
Counts
1 → 15
Calls
1 calls:
Slowest
3.0ms
(* d1 (+ d2 (+ 3 d3)))

series27.0ms

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

simplify329.0ms

Counts
10 → 18
Calls
10 calls:
Slowest
170.0ms
(+ (* d2 d2) (- (* (+ 3 d3) (+ 3 d3)) (* d2 (+ 3 d3))))
48.0ms
(+ (* d2 d1) (+ (* d3 d1) (* 3 d1)))
34.0ms
(+ (* d2 d1) (+ (* d3 d1) (* 3 d1)))
30.0ms
(+ (* d2 d1) (+ (* d3 d1) (* 3 d1)))
18.0ms
(- d2 (+ 3 d3))

prune210.0ms

Pruning

4 alts after pruning (4 fresh and 0 done)

Merged error: 0.0b

localize15.0ms

Local error

Found 2 expressions with local error:

0.0b
(+ (* d1 d2) (* d1 (+ 3 d3)))
0.0b
(* d1 (+ 3 d3))

rewrite10.0ms

Algorithm
rewrite-expression-head
Rules
add-log-exp
add-cube-cbrt
associate-*r*
*-un-lft-identity
add-sqr-sqrt
flip-+
add-exp-log
associate-*r/
add-cbrt-cube
flip3-+
distribute-lft-in
associate-+r+
pow1
distribute-rgt-in
distribute-lft-out
*-commutative
sum-log
+-commutative
Counts
2 → 29
Calls
2 calls:
Slowest
5.0ms
(+ (* d1 d2) (* d1 (+ 3 d3)))
4.0ms
(* d1 (+ 3 d3))

series43.0ms

Counts
2 → 6
Calls
2 calls:
Slowest
27.0ms
(+ (* d1 d2) (* d1 (+ 3 d3)))
16.0ms
(* d1 (+ 3 d3))

simplify303.0ms

Counts
17 → 35
Calls
17 calls:
Slowest
117.0ms
(* (exp (* d1 d2)) (exp (* d1 (+ 3 d3))))
44.0ms
(+ (* d2 d1) (+ (* d3 d1) (* 3 d1)))
43.0ms
(+ (* 3 3) (- (* d3 d3) (* 3 d3)))
42.0ms
(+ (* d2 d1) (+ (* d3 d1) (* 3 d1)))
23.0ms
(+ (* d2 d1) (+ (* d3 d1) (* 3 d1)))

prune243.0ms

Pruning

4 alts after pruning (3 fresh and 1 done)

Merged error: 0.0b

localize10.0ms

Local error

Found 4 expressions with local error:

0.3b
(* (* d1 (* (cbrt (+ d2 (+ 3 d3))) (cbrt (+ d2 (+ 3 d3))))) (cbrt (+ d2 (+ 3 d3))))
0.3b
(cbrt (+ d2 (+ 3 d3)))
0.3b
(cbrt (+ d2 (+ 3 d3)))
0.3b
(cbrt (+ d2 (+ 3 d3)))

rewrite22.0ms

Algorithm
rewrite-expression-head
Rules
60×cbrt-div
32×associate-*r/
30×flip-+
30×flip3-+
28×frac-times
14×associate-*l/
12×cbrt-prod
add-cube-cbrt
*-un-lft-identity
add-sqr-sqrt
add-exp-log
associate-*r*
pow1
add-cbrt-cube
add-log-exp
pow1/3
cbrt-unprod
*-commutative
prod-exp
pow-prod-down
associate-*l*
Counts
4 → 83
Calls
4 calls:
Slowest
15.0ms
(* (* d1 (* (cbrt (+ d2 (+ 3 d3))) (cbrt (+ d2 (+ 3 d3))))) (cbrt (+ d2 (+ 3 d3))))
1.0ms
(cbrt (+ d2 (+ 3 d3)))
1.0ms
(cbrt (+ d2 (+ 3 d3)))
1.0ms
(cbrt (+ d2 (+ 3 d3)))

series271.0ms

Counts
4 → 12
Calls
4 calls:
Slowest
97.0ms
(cbrt (+ d2 (+ 3 d3)))
83.0ms
(cbrt (+ d2 (+ 3 d3)))
61.0ms
(cbrt (+ d2 (+ 3 d3)))
30.0ms
(* (* d1 (* (cbrt (+ d2 (+ 3 d3))) (cbrt (+ d2 (+ 3 d3))))) (cbrt (+ d2 (+ 3 d3))))

simplify14.2s

Counts
78 → 95
Calls
78 calls:
Slowest
560.0ms
(* (* d1 (* (cbrt (+ d2 (+ 3 d3))) (cbrt (- (* d2 d2) (* (+ 3 d3) (+ 3 d3)))))) (cbrt (- (* d2 d2) (* (+ 3 d3) (+ 3 d3)))))
528.0ms
(* (* d1 (* (cbrt (- (* d2 d2) (* (+ 3 d3) (+ 3 d3)))) (cbrt (- (* d2 d2) (* (+ 3 d3) (+ 3 d3)))))) (cbrt (- (* d2 d2) (* (+ 3 d3) (+ 3 d3)))))
475.0ms
(* (* d1 (* (cbrt (- (* d2 d2) (* (+ 3 d3) (+ 3 d3)))) (cbrt (+ d2 (+ 3 d3))))) (cbrt (+ d2 (+ 3 d3))))
475.0ms
(* (* d1 (* (cbrt (- (* d2 d2) (* (+ 3 d3) (+ 3 d3)))) (cbrt (- (* d2 d2) (* (+ 3 d3) (+ 3 d3)))))) (cbrt (+ d2 (+ 3 d3))))
475.0ms
(* (* d1 (* (cbrt (+ d2 (+ 3 d3))) (cbrt (- (* d2 d2) (* (+ 3 d3) (+ 3 d3)))))) (cbrt (+ d2 (+ 3 d3))))

prune1.1s

Pruning

5 alts after pruning (3 fresh and 2 done)

Merged error: 0b

localize27.0ms

Local error

Found 4 expressions with local error:

8.4b
(/ (* d1 (- (* 3 3) (* d3 d3))) (- 3 d3))
4.3b
(* d1 (- (* 3 3) (* d3 d3)))
0.0b
(+ (* d1 d2) (/ (* d1 (- (* 3 3) (* d3 d3))) (- 3 d3)))
0.0b
(- (* 3 3) (* d3 d3))

rewrite29.0ms

Algorithm
rewrite-expression-head
Rules
add-log-exp
add-cube-cbrt
*-un-lft-identity
add-sqr-sqrt
add-exp-log
add-cbrt-cube
flip--
associate-*r/
associate-*r*
flip3--
pow1
times-frac
sub-neg
associate-/r*
associate-/l/
difference-of-squares
associate-/r/
distribute-lft-in
distribute-rgt-in
associate-/l*
div-inv
flip-+
*-commutative
div-exp
diff-log
flip3-+
frac-2neg
sum-log
clear-num
+-commutative
cbrt-undiv
Counts
4 → 65
Calls
4 calls:
Slowest
12.0ms
(/ (* d1 (- (* 3 3) (* d3 d3))) (- 3 d3))
7.0ms
(* d1 (- (* 3 3) (* d3 d3)))
7.0ms
(+ (* d1 d2) (/ (* d1 (- (* 3 3) (* d3 d3))) (- 3 d3)))
2.0ms
(- (* 3 3) (* d3 d3))

series161.0ms

Counts
4 → 12
Calls
4 calls:
Slowest
63.0ms
(+ (* d1 d2) (/ (* d1 (- (* 3 3) (* d3 d3))) (- 3 d3)))
39.0ms
(/ (* d1 (- (* 3 3) (* d3 d3))) (- 3 d3))
30.0ms
(- (* 3 3) (* d3 d3))
29.0ms
(* d1 (- (* 3 3) (* d3 d3)))

simplify2.5s

Counts
41 → 77
Calls
41 calls:
Slowest
533.0ms
(/ (- (* 3 3) (* d3 d3)) (- 3 d3))
398.0ms
(* d1 (- (pow (* 3 3) 3) (pow (* d3 d3) 3)))
284.0ms
(* d1 (- (* (* 3 3) (* 3 3)) (* (* d3 d3) (* d3 d3))))
237.0ms
(- (log (* d1 (- (* 3 3) (* d3 d3)))) (log (- 3 d3)))
169.0ms
(/ (* (* (* d1 (- (* 3 3) (* d3 d3))) (* d1 (- (* 3 3) (* d3 d3)))) (* d1 (- (* 3 3) (* d3 d3)))) (* (* (- 3 d3) (- 3 d3)) (- 3 d3)))

prune643.0ms

Pruning

4 alts after pruning (1 fresh and 3 done)

Merged error: 0b

regimes158.0ms

Accuracy

0% (0.1b remaining)

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

bsearch2.0ms

end0.0ms

sample1.5s

Algorithm
intervals
Results
776.0ms9474×body80valid
463.0ms89×body1280valid
84.0ms217×body640valid
59.0ms140×body320valid
10.0ms78×body160valid