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

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 add-sqr-sqrt0.5

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

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

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

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

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

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

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

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

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

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

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

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

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

Reproduce

herbie shell --seed 2019002 
(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: 1.2m)Debug log

sample273.0ms

Algorithm
intervals

simplify90.0ms

Counts
1 → 1
Calls

1 calls. Slowest were:

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

prune20.0ms

Pruning

2 alts after pruning (2 fresh and 0 done)

Merged error: 0.5b

localize33.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.3b
(* (/ (cos th) (sqrt 2)) (* a2 a2))

rewrite36.0ms

Algorithm
rewrite-expression-head
Counts
4 → 110
Calls

4 calls. Slowest were:

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

series235.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

81.0ms
(* (/ (cos th) (sqrt 2)) (* a2 a2))
79.0ms
(* (/ (cos th) (sqrt 2)) (* a1 a1))
40.0ms
(/ (cos th) (sqrt 2))
34.0ms
(/ (cos th) (sqrt 2))

simplify3.5s

Counts
98 → 122
Calls

98 calls. Slowest were:

629.0ms
(- (/ (pow a2 2) (sqrt 2)) (* 1/2 (/ (* (pow a2 2) (pow th 2)) (sqrt 2))))
380.0ms
(* (* (* (/ (cos th) (sqrt 2)) (/ (cos th) (sqrt 2))) (/ (cos th) (sqrt 2))) (* (* (* a1 a1) (* a1 a1)) (* a1 a1)))
358.0ms
(* (* (* (/ (cos th) (sqrt 2)) (/ (cos th) (sqrt 2))) (/ (cos th) (sqrt 2))) (* (* (* a2 a2) (* a2 a2)) (* a2 a2)))

prune1.5s

Pruning

10 alts after pruning (10 fresh and 0 done)

Merged error: 0b

localize28.0ms

Local error

Found 4 expressions with local error:

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

rewrite50.0ms

Algorithm
rewrite-expression-head
Counts
4 → 269
Calls

4 calls. Slowest were:

15.0ms
(/ (/ (cos th) (sqrt (sqrt 2))) (sqrt (sqrt 2)))
11.0ms
(* (/ (cos th) (sqrt 2)) (* a1 a1))
7.0ms
(/ (cos th) (sqrt (sqrt 2)))

series249.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

82.0ms
(* (/ (cos th) (sqrt 2)) (* a1 a1))
60.0ms
(/ (cos th) (sqrt (sqrt 2)))
58.0ms
(/ (/ (cos th) (sqrt (sqrt 2))) (sqrt (sqrt 2)))
49.0ms
(/ (cos th) (sqrt 2))

simplify7.8s

Counts
397 → 281
Calls

397 calls. Slowest were:

487.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))))
394.0ms
(* (* (* (/ (cos th) (sqrt 2)) (/ (cos th) (sqrt 2))) (/ (cos th) (sqrt 2))) (* (* (* a1 a1) (* a1 a1)) (* a1 a1)))
277.0ms
(- (/ (pow a1 2) (sqrt 2)) (* 1/2 (/ (* (pow a1 2) (pow th 2)) (sqrt 2))))

prune4.2s

Pruning

9 alts after pruning (9 fresh and 0 done)

Merged error: 0b

localize45.0ms

Local error

Found 4 expressions with local error:

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

rewrite28.0ms

Algorithm
rewrite-expression-head
Counts
4 → 338
Calls

4 calls. Slowest were:

8.0ms
(/ (/ (cos th) (sqrt (sqrt 2))) (sqrt (cbrt (sqrt 2))))
6.0ms
(* (/ (cos th) (sqrt 2)) (* a1 a1))
4.0ms
(/ (cos th) (sqrt (sqrt 2)))

series618.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

420.0ms
(/ (/ (cos th) (sqrt (sqrt 2))) (sqrt (cbrt (sqrt 2))))
76.0ms
(* (/ (cos th) (sqrt 2)) (* a1 a1))
73.0ms
(/ (cos th) (sqrt (sqrt 2)))
49.0ms
(/ (cos th) (sqrt 2))

simplify11.2s

Counts
532 → 350
Calls

532 calls. Slowest were:

383.0ms
(/ (/ (* (* (cos th) (cos th)) (cos th)) (* (* (sqrt (sqrt 2)) (sqrt (sqrt 2))) (sqrt (sqrt 2)))) (* (* (sqrt (cbrt (sqrt 2))) (sqrt (cbrt (sqrt 2)))) (sqrt (cbrt (sqrt 2)))))
351.0ms
(* (* (* (/ (cos th) (sqrt 2)) (/ (cos th) (sqrt 2))) (/ (cos th) (sqrt 2))) (* (* (* a1 a1) (* a1 a1)) (* a1 a1)))
306.0ms
(- (/ (pow a1 2) (sqrt 2)) (* 1/2 (/ (* (pow a1 2) (pow th 2)) (sqrt 2))))

prune7.0s

Pruning

8 alts after pruning (8 fresh and 0 done)

Merged error: 0b

localize6.0ms

Local error

Found 4 expressions with local error:

0.7b
(/ (/ (cos th) (sqrt (sqrt 2))) (sqrt (sqrt 2)))
0.7b
(/ (/ (cos th) (sqrt (sqrt 2))) (sqrt (cbrt (sqrt 2))))
0.6b
(/ (cos th) (sqrt (sqrt 2)))
0.6b
(/ (cos th) (sqrt (sqrt 2)))

rewrite35.0ms

Algorithm
rewrite-expression-head
Counts
4 → 497
Calls

4 calls. Slowest were:

8.0ms
(/ (/ (cos th) (sqrt (sqrt 2))) (sqrt (cbrt (sqrt 2))))
8.0ms
(/ (/ (cos th) (sqrt (sqrt 2))) (sqrt (sqrt 2)))
4.0ms
(/ (cos th) (sqrt (sqrt 2)))

series664.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

477.0ms
(/ (/ (cos th) (sqrt (sqrt 2))) (sqrt (cbrt (sqrt 2))))
69.0ms
(/ (cos th) (sqrt (sqrt 2)))
66.0ms
(/ (cos th) (sqrt (sqrt 2)))
52.0ms
(/ (/ (cos th) (sqrt (sqrt 2))) (sqrt (sqrt 2)))

simplify15.9s

Counts
831 → 509
Calls

831 calls. Slowest were:

483.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))))
419.0ms
(/ (/ (* (* (cos th) (cos th)) (cos th)) (* (* (sqrt (sqrt 2)) (sqrt (sqrt 2))) (sqrt (sqrt 2)))) (* (* (sqrt (cbrt (sqrt 2))) (sqrt (cbrt (sqrt 2)))) (sqrt (cbrt (sqrt 2)))))
264.0ms
(/ (/ (* (cbrt (cos th)) (cbrt (cos th))) (* (cbrt (sqrt (sqrt 2))) (cbrt (sqrt (sqrt 2))))) (* (cbrt (sqrt (cbrt (sqrt 2)))) (cbrt (sqrt (cbrt (sqrt 2))))))

prune10.1s

Pruning

8 alts after pruning (7 fresh and 1 done)

Merged error: 0b

regimes589.0ms

Accuracy

0% (0.4b remaining)

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

bsearch3.0ms

end0.0ms

sample8.1s

Algorithm
intervals