Average Error: 0.5 → 0.5
Time: 43.3s
Precision: 64
Internal Precision: 128
\[\frac{\cos th}{\sqrt{2}} \cdot \left(a1 \cdot a1\right) + \frac{\cos th}{\sqrt{2}} \cdot \left(a2 \cdot a2\right)\]
\[\frac{\frac{\frac{(a1 \cdot a1 + \left(a2 \cdot a2\right))_* \cdot \cos th}{\sqrt[3]{\sqrt{2}} \cdot \sqrt[3]{\sqrt{2}}}}{\sqrt[3]{\sqrt[3]{\sqrt{2}}} \cdot \sqrt[3]{\sqrt[3]{\sqrt{2}}}}}{\sqrt[3]{\sqrt[3]{\sqrt{2}}}}\]

Error

Bits error versus a1

Bits error versus a2

Bits error versus th

Derivation

  1. Initial program 0.5

    \[\frac{\cos th}{\sqrt{2}} \cdot \left(a1 \cdot a1\right) + \frac{\cos th}{\sqrt{2}} \cdot \left(a2 \cdot a2\right)\]
  2. Simplified0.5

    \[\leadsto \color{blue}{\frac{\cos th}{\sqrt{2}} \cdot (a1 \cdot a1 + \left(a2 \cdot a2\right))_*}\]
  3. Using strategy rm
  4. Applied associate-*l/0.5

    \[\leadsto \color{blue}{\frac{\cos th \cdot (a1 \cdot a1 + \left(a2 \cdot a2\right))_*}{\sqrt{2}}}\]
  5. Using strategy rm
  6. Applied add-cube-cbrt0.5

    \[\leadsto \frac{\cos th \cdot (a1 \cdot a1 + \left(a2 \cdot a2\right))_*}{\color{blue}{\left(\sqrt[3]{\sqrt{2}} \cdot \sqrt[3]{\sqrt{2}}\right) \cdot \sqrt[3]{\sqrt{2}}}}\]
  7. Applied associate-/r*0.5

    \[\leadsto \color{blue}{\frac{\frac{\cos th \cdot (a1 \cdot a1 + \left(a2 \cdot a2\right))_*}{\sqrt[3]{\sqrt{2}} \cdot \sqrt[3]{\sqrt{2}}}}{\sqrt[3]{\sqrt{2}}}}\]
  8. Using strategy rm
  9. Applied add-cube-cbrt0.5

    \[\leadsto \frac{\frac{\cos th \cdot (a1 \cdot a1 + \left(a2 \cdot a2\right))_*}{\sqrt[3]{\sqrt{2}} \cdot \sqrt[3]{\sqrt{2}}}}{\color{blue}{\left(\sqrt[3]{\sqrt[3]{\sqrt{2}}} \cdot \sqrt[3]{\sqrt[3]{\sqrt{2}}}\right) \cdot \sqrt[3]{\sqrt[3]{\sqrt{2}}}}}\]
  10. Applied associate-/r*0.5

    \[\leadsto \color{blue}{\frac{\frac{\frac{\cos th \cdot (a1 \cdot a1 + \left(a2 \cdot a2\right))_*}{\sqrt[3]{\sqrt{2}} \cdot \sqrt[3]{\sqrt{2}}}}{\sqrt[3]{\sqrt[3]{\sqrt{2}}} \cdot \sqrt[3]{\sqrt[3]{\sqrt{2}}}}}{\sqrt[3]{\sqrt[3]{\sqrt{2}}}}}\]
  11. Final simplification0.5

    \[\leadsto \frac{\frac{\frac{(a1 \cdot a1 + \left(a2 \cdot a2\right))_* \cdot \cos th}{\sqrt[3]{\sqrt{2}} \cdot \sqrt[3]{\sqrt{2}}}}{\sqrt[3]{\sqrt[3]{\sqrt{2}}} \cdot \sqrt[3]{\sqrt[3]{\sqrt{2}}}}}{\sqrt[3]{\sqrt[3]{\sqrt{2}}}}\]

Reproduce

herbie shell --seed 2019008 +o rules:numerics
(FPCore (a1 a2 th)
  :name "Migdal et al, Equation (64)"
  (+ (* (/ (cos th) (sqrt 2)) (* a1 a1)) (* (/ (cos th) (sqrt 2)) (* a2 a2))))

Details

Time bar (total: 42.3s)Debug log

sample296.0ms

Algorithm
intervals

simplify94.0ms

Counts
1 → 1
Calls

1 calls. Slowest were:

94.0ms
(+ (* (/ (cos th) (sqrt 2)) (* a1 a1)) (* (/ (cos th) (sqrt 2)) (* a2 a2)))

prune25.0ms

Pruning

2 alts after pruning (2 fresh and 0 done)

Merged error: 0.5b

localize38.0ms

Local error

Found 3 expressions with local error:

0.7b
(/ (cos th) (sqrt 2))
0.4b
(* (/ (cos th) (sqrt 2)) (fma a1 a1 (* a2 a2)))
0.0b
(fma a1 a1 (* a2 a2))

rewrite20.0ms

Algorithm
rewrite-expression-head
Counts
3 → 73
Calls

3 calls. Slowest were:

12.0ms
(* (/ (cos th) (sqrt 2)) (fma a1 a1 (* a2 a2)))
7.0ms
(/ (cos th) (sqrt 2))
0.0ms
(fma a1 a1 (* a2 a2))

series248.0ms

Counts
3 → 9
Calls

3 calls. Slowest were:

173.0ms
(* (/ (cos th) (sqrt 2)) (fma a1 a1 (* a2 a2)))
57.0ms
(/ (cos th) (sqrt 2))
18.0ms
(fma a1 a1 (* a2 a2))

simplify1.2s

Counts
57 → 82
Calls

57 calls. Slowest were:

265.0ms
(/ (* (* (cos th) (cos th)) (cos th)) (* (* (sqrt 2) (sqrt 2)) (sqrt 2)))
143.0ms
(- (+ (/ 1 (sqrt 2)) (* 1/24 (/ (pow th 4) (sqrt 2)))) (* 1/2 (/ (pow th 2) (sqrt 2))))
136.0ms
(* (/ (* (* (cos th) (cos th)) (cos th)) (* (* (sqrt 2) (sqrt 2)) (sqrt 2))) (* (* (fma a1 a1 (* a2 a2)) (fma a1 a1 (* a2 a2))) (fma a1 a1 (* a2 a2))))

prune1.0s

Pruning

9 alts after pruning (9 fresh and 0 done)

Merged error: 0b

localize11.0ms

Local error

Found 3 expressions with local error:

0.4b
(/ (* (cos th) (fma a1 a1 (* a2 a2))) (sqrt 2))
0.2b
(* (cos th) (fma a1 a1 (* a2 a2)))
0.0b
(fma a1 a1 (* a2 a2))

rewrite26.0ms

Algorithm
rewrite-expression-head
Counts
3 → 54
Calls

3 calls. Slowest were:

14.0ms
(/ (* (cos th) (fma a1 a1 (* a2 a2))) (sqrt 2))
11.0ms
(* (cos th) (fma a1 a1 (* a2 a2)))
0.0ms
(fma a1 a1 (* a2 a2))

series339.0ms

Counts
3 → 9
Calls

3 calls. Slowest were:

212.0ms
(/ (* (cos th) (fma a1 a1 (* a2 a2))) (sqrt 2))
104.0ms
(* (cos th) (fma a1 a1 (* a2 a2)))
23.0ms
(fma a1 a1 (* a2 a2))

simplify927.0ms

Counts
33 → 63
Calls

33 calls. Slowest were:

394.0ms
(* (* (* (cos th) (cos th)) (cos th)) (* (* (fma a1 a1 (* a2 a2)) (fma a1 a1 (* a2 a2))) (fma a1 a1 (* a2 a2))))
89.0ms
(/ (* (* (* (cos th) (cos th)) (cos th)) (* (* (fma a1 a1 (* a2 a2)) (fma a1 a1 (* a2 a2))) (fma a1 a1 (* a2 a2)))) (* (* (sqrt 2) (sqrt 2)) (sqrt 2)))
62.0ms
(+ (/ (* (pow a1 2) (cos th)) (sqrt 2)) (/ (* (cos th) (pow a2 2)) (sqrt 2)))

prune908.0ms

Pruning

7 alts after pruning (7 fresh and 0 done)

Merged error: 0b

localize22.0ms

Local error

Found 4 expressions with local error:

0.3b
(/ (/ (* (cos th) (fma a1 a1 (* a2 a2))) (* (cbrt (sqrt 2)) (cbrt (sqrt 2)))) (cbrt (sqrt 2)))
0.2b
(/ (* (cos th) (fma a1 a1 (* a2 a2))) (* (cbrt (sqrt 2)) (cbrt (sqrt 2))))
0.2b
(* (cos th) (fma a1 a1 (* a2 a2)))
0.0b
(fma a1 a1 (* a2 a2))

rewrite61.0ms

Algorithm
rewrite-expression-head
Counts
4 → 118
Calls

4 calls. Slowest were:

27.0ms
(/ (/ (* (cos th) (fma a1 a1 (* a2 a2))) (* (cbrt (sqrt 2)) (cbrt (sqrt 2)))) (cbrt (sqrt 2)))
19.0ms
(/ (* (cos th) (fma a1 a1 (* a2 a2))) (* (cbrt (sqrt 2)) (cbrt (sqrt 2))))
8.0ms
(* (cos th) (fma a1 a1 (* a2 a2)))

series1.2s

Counts
4 → 12
Calls

4 calls. Slowest were:

869.0ms
(/ (* (cos th) (fma a1 a1 (* a2 a2))) (* (cbrt (sqrt 2)) (cbrt (sqrt 2))))
143.0ms
(/ (/ (* (cos th) (fma a1 a1 (* a2 a2))) (* (cbrt (sqrt 2)) (cbrt (sqrt 2)))) (cbrt (sqrt 2)))
110.0ms
(* (cos th) (fma a1 a1 (* a2 a2)))
31.0ms
(fma a1 a1 (* a2 a2))

simplify11.4s

Counts
115 → 130
Calls

115 calls. Slowest were:

876.0ms
(/ (/ (* (* (* (cos th) (fma a1 a1 (* a2 a2))) (* (cos th) (fma a1 a1 (* a2 a2)))) (* (cos th) (fma a1 a1 (* a2 a2)))) (* (sqrt 2) (sqrt 2))) (sqrt 2))
477.0ms
(/ (* (* (* (cos th) (cos th)) (cos th)) (* (* (fma a1 a1 (* a2 a2)) (fma a1 a1 (* a2 a2))) (fma a1 a1 (* a2 a2)))) (* (sqrt 2) (sqrt 2)))
437.0ms
(* (* (* (cos th) (cos th)) (cos th)) (* (* (fma a1 a1 (* a2 a2)) (fma a1 a1 (* a2 a2))) (fma a1 a1 (* a2 a2))))

prune1.7s

Pruning

6 alts after pruning (6 fresh and 0 done)

Merged error: 0b

localize13.0ms

Local error

Found 3 expressions with local error:

0.3b
(/ (/ (* (cos th) (fma a2 a2 (* a1 a1))) (* (cbrt (sqrt 2)) (cbrt (sqrt 2)))) (cbrt (sqrt 2)))
0.2b
(/ (* (cos th) (fma a2 a2 (* a1 a1))) (* (cbrt (sqrt 2)) (cbrt (sqrt 2))))
0.2b
(* (cos th) (fma a2 a2 (* a1 a1)))

rewrite34.0ms

Algorithm
rewrite-expression-head
Counts
3 → 108
Calls

3 calls. Slowest were:

14.0ms
(/ (/ (* (cos th) (fma a2 a2 (* a1 a1))) (* (cbrt (sqrt 2)) (cbrt (sqrt 2)))) (cbrt (sqrt 2)))
10.0ms
(/ (* (cos th) (fma a2 a2 (* a1 a1))) (* (cbrt (sqrt 2)) (cbrt (sqrt 2))))
8.0ms
(* (cos th) (fma a2 a2 (* a1 a1)))

series1.0s

Counts
3 → 9
Calls

3 calls. Slowest were:

757.0ms
(/ (* (cos th) (fma a2 a2 (* a1 a1))) (* (cbrt (sqrt 2)) (cbrt (sqrt 2))))
177.0ms
(/ (/ (* (cos th) (fma a2 a2 (* a1 a1))) (* (cbrt (sqrt 2)) (cbrt (sqrt 2)))) (cbrt (sqrt 2)))
107.0ms
(* (cos th) (fma a2 a2 (* a1 a1)))

simplify10.8s

Counts
112 → 117
Calls

112 calls. Slowest were:

583.0ms
(/ (* (* (* (cos th) (cos th)) (cos th)) (* (* (fma a2 a2 (* a1 a1)) (fma a2 a2 (* a1 a1))) (fma a2 a2 (* a1 a1)))) (* (sqrt 2) (sqrt 2)))
483.0ms
(/ (/ (* (* (* (cos th) (fma a2 a2 (* a1 a1))) (* (cos th) (fma a2 a2 (* a1 a1)))) (* (cos th) (fma a2 a2 (* a1 a1)))) (* (sqrt 2) (sqrt 2))) (sqrt 2))
454.0ms
(* (* (* (cos th) (cos th)) (cos th)) (* (* (fma a2 a2 (* a1 a1)) (fma a2 a2 (* a1 a1))) (fma a2 a2 (* a1 a1))))

prune1.5s

Pruning

6 alts after pruning (5 fresh and 1 done)

Merged error: 0b

regimes413.0ms

Accuracy

0% (0.4b remaining)

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

bsearch4.0ms

end0.0ms

sample8.9s

Algorithm
intervals