Average Error: 0.5 → 0.5
Time: 58.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)\]
\[a2 \cdot \left(\left(\frac{\frac{\cos th}{\sqrt{\sqrt{\sqrt{2}}}}}{\sqrt{\sqrt{\sqrt{2}}}} \cdot a2\right) \cdot \frac{1}{\sqrt{\sqrt{2}}}\right) + \left(a1 \cdot a1\right) \cdot \frac{\frac{\cos th}{\sqrt[3]{\sqrt{2}} \cdot \sqrt[3]{\sqrt{2}}}}{\sqrt[3]{\sqrt{2}}}\]

Error

Bits error versus a1

Bits error versus a2

Bits error versus th

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

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. Using strategy rm
  3. Applied associate-*r*0.5

    \[\leadsto \frac{\cos th}{\sqrt{2}} \cdot \left(a1 \cdot a1\right) + \color{blue}{\left(\frac{\cos th}{\sqrt{2}} \cdot a2\right) \cdot a2}\]
  4. Using strategy rm
  5. Applied add-sqr-sqrt0.5

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

    \[\leadsto \frac{\cos th}{\sqrt{2}} \cdot \left(a1 \cdot a1\right) + \left(\color{blue}{\frac{\frac{\cos th}{\sqrt{\sqrt{2}}}}{\sqrt{\sqrt{2}}}} \cdot a2\right) \cdot a2\]
  7. Using strategy rm
  8. Applied add-sqr-sqrt0.5

    \[\leadsto \frac{\cos th}{\sqrt{2}} \cdot \left(a1 \cdot a1\right) + \left(\frac{\frac{\cos th}{\sqrt{\sqrt{2}}}}{\sqrt{\color{blue}{\sqrt{\sqrt{2}} \cdot \sqrt{\sqrt{2}}}}} \cdot a2\right) \cdot a2\]
  9. Applied sqrt-prod0.5

    \[\leadsto \frac{\cos th}{\sqrt{2}} \cdot \left(a1 \cdot a1\right) + \left(\frac{\frac{\cos th}{\sqrt{\sqrt{2}}}}{\color{blue}{\sqrt{\sqrt{\sqrt{2}}} \cdot \sqrt{\sqrt{\sqrt{2}}}}} \cdot a2\right) \cdot a2\]
  10. Applied add-sqr-sqrt0.5

    \[\leadsto \frac{\cos th}{\sqrt{2}} \cdot \left(a1 \cdot a1\right) + \left(\frac{\frac{\cos th}{\sqrt{\color{blue}{\sqrt{\sqrt{2}} \cdot \sqrt{\sqrt{2}}}}}}{\sqrt{\sqrt{\sqrt{2}}} \cdot \sqrt{\sqrt{\sqrt{2}}}} \cdot a2\right) \cdot a2\]
  11. Applied sqrt-prod0.5

    \[\leadsto \frac{\cos th}{\sqrt{2}} \cdot \left(a1 \cdot a1\right) + \left(\frac{\frac{\cos th}{\color{blue}{\sqrt{\sqrt{\sqrt{2}}} \cdot \sqrt{\sqrt{\sqrt{2}}}}}}{\sqrt{\sqrt{\sqrt{2}}} \cdot \sqrt{\sqrt{\sqrt{2}}}} \cdot a2\right) \cdot a2\]
  12. Applied *-un-lft-identity0.5

    \[\leadsto \frac{\cos th}{\sqrt{2}} \cdot \left(a1 \cdot a1\right) + \left(\frac{\frac{\color{blue}{1 \cdot \cos th}}{\sqrt{\sqrt{\sqrt{2}}} \cdot \sqrt{\sqrt{\sqrt{2}}}}}{\sqrt{\sqrt{\sqrt{2}}} \cdot \sqrt{\sqrt{\sqrt{2}}}} \cdot a2\right) \cdot a2\]
  13. Applied times-frac0.5

    \[\leadsto \frac{\cos th}{\sqrt{2}} \cdot \left(a1 \cdot a1\right) + \left(\frac{\color{blue}{\frac{1}{\sqrt{\sqrt{\sqrt{2}}}} \cdot \frac{\cos th}{\sqrt{\sqrt{\sqrt{2}}}}}}{\sqrt{\sqrt{\sqrt{2}}} \cdot \sqrt{\sqrt{\sqrt{2}}}} \cdot a2\right) \cdot a2\]
  14. Applied times-frac0.5

    \[\leadsto \frac{\cos th}{\sqrt{2}} \cdot \left(a1 \cdot a1\right) + \left(\color{blue}{\left(\frac{\frac{1}{\sqrt{\sqrt{\sqrt{2}}}}}{\sqrt{\sqrt{\sqrt{2}}}} \cdot \frac{\frac{\cos th}{\sqrt{\sqrt{\sqrt{2}}}}}{\sqrt{\sqrt{\sqrt{2}}}}\right)} \cdot a2\right) \cdot a2\]
  15. Applied associate-*l*0.5

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

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

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

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

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

Reproduce

herbie shell --seed 2019005 
(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: 57.0s)Debug log

sample268.0ms

Algorithm
intervals

simplify93.0ms

Counts
1 → 1
Calls

1 calls. Slowest were:

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

prune24.0ms

Pruning

2 alts after pruning (2 fresh and 0 done)

Merged error: 0.5b

localize24.0ms

Local error

Found 4 expressions with local error:

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

rewrite41.0ms

Algorithm
rewrite-expression-head
Counts
4 → 110
Calls

4 calls. Slowest were:

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

series285.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

97.0ms
(* (/ (cos th) (sqrt 2)) (* a1 a1))
96.0ms
(* (/ (cos th) (sqrt 2)) (* a2 a2))
58.0ms
(/ (cos th) (sqrt 2))
33.0ms
(/ (cos th) (sqrt 2))

simplify3.6s

Counts
98 → 122
Calls

98 calls. Slowest were:

454.0ms
(* (* (* (/ (cos th) (sqrt 2)) (/ (cos th) (sqrt 2))) (/ (cos th) (sqrt 2))) (* (* (* a2 a2) (* a2 a2)) (* a2 a2)))
406.0ms
(* (* (* (/ (cos th) (sqrt 2)) (/ (cos th) (sqrt 2))) (/ (cos th) (sqrt 2))) (* (* (* a1 a1) (* a1 a1)) (* a1 a1)))
332.0ms
(- (/ (pow a1 2) (sqrt 2)) (* 1/2 (/ (* (pow a1 2) (pow th 2)) (sqrt 2))))

prune1.8s

Pruning

15 alts after pruning (15 fresh and 0 done)

Merged error: 0b

localize9.0ms

Local error

Found 4 expressions with local error:

0.7b
(/ (cos th) (sqrt 2))
0.7b
(/ (cos th) (sqrt 2))
0.3b
(* (/ (cos th) (sqrt 2)) a2)
0.3b
(* (/ (cos th) (sqrt 2)) (* a1 a1))

rewrite20.0ms

Algorithm
rewrite-expression-head
Counts
4 → 104
Calls

4 calls. Slowest were:

6.0ms
(* (/ (cos th) (sqrt 2)) (* a1 a1))
5.0ms
(* (/ (cos th) (sqrt 2)) a2)
4.0ms
(/ (cos th) (sqrt 2))

series289.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

100.0ms
(* (/ (cos th) (sqrt 2)) (* a1 a1))
94.0ms
(* (/ (cos th) (sqrt 2)) a2)
54.0ms
(/ (cos th) (sqrt 2))
41.0ms
(/ (cos th) (sqrt 2))

simplify3.2s

Counts
93 → 116
Calls

93 calls. Slowest were:

477.0ms
(- (+ (/ 1 (sqrt 2)) (* 1/24 (/ (pow th 4) (sqrt 2)))) (* 1/2 (/ (pow th 2) (sqrt 2))))
462.0ms
(* (* (* (/ (cos th) (sqrt 2)) (/ (cos th) (sqrt 2))) (/ (cos th) (sqrt 2))) (* (* (* a1 a1) (* a1 a1)) (* a1 a1)))
394.0ms
(- (/ a2 (sqrt 2)) (* 1/2 (/ (* a2 (pow th 2)) (sqrt 2))))

prune1.7s

Pruning

12 alts after pruning (12 fresh and 0 done)

Merged error: 0b

localize16.0ms

Local error

Found 4 expressions with local error:

0.7b
(/ (cos th) (sqrt 2))
0.6b
(/ (/ (cos th) (sqrt (sqrt 2))) (sqrt (sqrt 2)))
0.6b
(/ (cos th) (sqrt (sqrt 2)))
0.3b
(* (/ (/ (cos th) (sqrt (sqrt 2))) (sqrt (sqrt 2))) a2)

rewrite61.0ms

Algorithm
rewrite-expression-head
Counts
4 → 386
Calls

4 calls. Slowest were:

24.0ms
(* (/ (/ (cos th) (sqrt (sqrt 2))) (sqrt (sqrt 2))) a2)
10.0ms
(/ (/ (cos th) (sqrt (sqrt 2))) (sqrt (sqrt 2)))
8.0ms
(/ (cos th) (sqrt (sqrt 2)))

series218.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

71.0ms
(* (/ (/ (cos th) (sqrt (sqrt 2))) (sqrt (sqrt 2))) a2)
63.0ms
(/ (cos th) (sqrt (sqrt 2)))
53.0ms
(/ (/ (cos th) (sqrt (sqrt 2))) (sqrt (sqrt 2)))
31.0ms
(/ (cos th) (sqrt 2))

simplify11.0s

Counts
515 → 398
Calls

515 calls. Slowest were:

447.0ms
(/ (* (* (/ (cos th) (sqrt (sqrt 2))) (/ (cos th) (sqrt (sqrt 2)))) (/ (cos th) (sqrt (sqrt 2)))) (* (* (sqrt (sqrt 2)) (sqrt (sqrt 2))) (sqrt (sqrt 2))))
350.0ms
(- (/ a2 (sqrt 2)) (* 1/2 (/ (* a2 (pow th 2)) (sqrt 2))))
262.0ms
(/ (* (* (cos th) (cos th)) (cos th)) (* (* (sqrt 2) (sqrt 2)) (sqrt 2)))

prune6.4s

Pruning

10 alts after pruning (10 fresh and 0 done)

Merged error: 0b

localize38.0ms

Local error

Found 4 expressions with local error:

1.0b
(/ 1 (sqrt (sqrt 2)))
0.7b
(/ (cos th) (sqrt 2))
0.4b
(* (/ 1 (sqrt (sqrt 2))) (* (/ (/ (cos th) (sqrt (sqrt (sqrt 2)))) (sqrt (sqrt (sqrt 2)))) a2))
0.3b
(* (/ (/ (cos th) (sqrt (sqrt (sqrt 2)))) (sqrt (sqrt (sqrt 2)))) a2)

rewrite67.0ms

Algorithm
rewrite-expression-head
Counts
4 → 359
Calls

4 calls. Slowest were:

23.0ms
(* (/ 1 (sqrt (sqrt 2))) (* (/ (/ (cos th) (sqrt (sqrt (sqrt 2)))) (sqrt (sqrt (sqrt 2)))) a2))
13.0ms
(* (/ (/ (cos th) (sqrt (sqrt (sqrt 2)))) (sqrt (sqrt (sqrt 2)))) a2)
7.0ms
(/ (cos th) (sqrt 2))

series216.0ms

Counts
4 → 10
Calls

4 calls. Slowest were:

107.0ms
(* (/ (/ (cos th) (sqrt (sqrt (sqrt 2)))) (sqrt (sqrt (sqrt 2)))) a2)
79.0ms
(* (/ 1 (sqrt (sqrt 2))) (* (/ (/ (cos th) (sqrt (sqrt (sqrt 2)))) (sqrt (sqrt (sqrt 2)))) a2))
30.0ms
(/ (cos th) (sqrt 2))
0.0ms
(/ 1 (sqrt (sqrt 2)))

simplify11.5s

Counts
336 → 369
Calls

336 calls. Slowest were:

600.0ms
(* (/ 1 (sqrt (sqrt 2))) (* (/ (/ (cos th) (sqrt (sqrt (sqrt 2)))) (sqrt (sqrt (sqrt 2)))) a2))
426.0ms
(+ (- (log (sqrt (sqrt 2)))) (log (* (/ (/ (cos th) (sqrt (sqrt (sqrt 2)))) (sqrt (sqrt (sqrt 2)))) a2)))
380.0ms
(- (/ a2 (sqrt 2)) (* 1/2 (/ (* a2 (pow th 2)) (sqrt 2))))

prune6.9s

Pruning

9 alts after pruning (9 fresh and 0 done)

Merged error: 0b

regimes524.0ms

Accuracy

0% (0.4b remaining)

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

bsearch4.0ms

end0.0ms

sample8.8s

Algorithm
intervals