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

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}{\color{blue}{\sqrt{\sqrt{2}} \cdot \sqrt{\sqrt{2}}}} \cdot \left(a1 \cdot a1\right) + \frac{\cos th}{\sqrt{2}} \cdot \left(a2 \cdot a2\right)\]
  4. Applied associate-/r*0.5

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

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

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

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

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

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

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

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

Reproduce

herbie shell --seed 2019010 
(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.1m)Debug log

sample254.0ms

Algorithm
intervals

simplify97.0ms

Counts
1 → 1
Calls
1 calls:
Slowest
97.0ms
(+ (* (/ (cos th) (sqrt 2)) (* a1 a1)) (* (/ (cos th) (sqrt 2)) (* a2 a2)))

prune13.0ms

Pruning

2 alts after pruning (2 fresh and 0 done)

Merged error: 0.5b

localize25.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 a2))
0.3b
(* (/ (cos th) (sqrt 2)) (* a1 a1))

rewrite36.0ms

Algorithm
rewrite-expression-head
Rules
36×times-frac
34×add-cube-cbrt
34×*-un-lft-identity
34×add-sqr-sqrt
26×associate-*l*
18×add-exp-log
18×add-cbrt-cube
pow1
associate-/l*
associate-/r*
add-log-exp
div-inv
cbrt-unprod
prod-exp
div-exp
cbrt-undiv
*-commutative
associate-*l/
pow-prod-down
associate-*r*
frac-2neg
clear-num
Counts
4 → 110
Calls
4 calls:
Slowest
12.0ms
(* (/ (cos th) (sqrt 2)) (* a2 a2))
12.0ms
(* (/ (cos th) (sqrt 2)) (* a1 a1))
6.0ms
(/ (cos th) (sqrt 2))
3.0ms
(/ (cos th) (sqrt 2))

series238.0ms

Counts
4 → 12
Calls
4 calls:
Slowest
93.0ms
(* (/ (cos th) (sqrt 2)) (* a1 a1))
80.0ms
(* (/ (cos th) (sqrt 2)) (* a2 a2))
34.0ms
(/ (cos th) (sqrt 2))
32.0ms
(/ (cos th) (sqrt 2))

simplify3.6s

Counts
98 → 122
Calls
98 calls:
Slowest
454.0ms
(* (* (* (/ (cos th) (sqrt 2)) (/ (cos th) (sqrt 2))) (/ (cos th) (sqrt 2))) (* (* (* a1 a1) (* a1 a1)) (* a1 a1)))
453.0ms
(+ (- (log (cos th)) (log (sqrt 2))) (log (* a1 a1)))
334.0ms
(- (/ (pow a1 2) (sqrt 2)) (* 1/2 (/ (* (pow a1 2) (pow th 2)) (sqrt 2))))
333.0ms
(* (* (* (/ (cos th) (sqrt 2)) (/ (cos th) (sqrt 2))) (/ (cos th) (sqrt 2))) (* (* (* a2 a2) (* a2 a2)) (* a2 a2)))
307.0ms
(- (/ (pow a2 2) (sqrt 2)) (* 1/2 (/ (* (pow a2 2) (pow th 2)) (sqrt 2))))

prune1.6s

Pruning

15 alts after pruning (15 fresh and 0 done)

Merged error: 0b

localize25.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)) (* a2 a2))

rewrite30.0ms

Algorithm
rewrite-expression-head
Rules
294×times-frac
171×add-cube-cbrt
171×*-un-lft-identity
171×add-sqr-sqrt
144×sqrt-prod
28×associate-/l*
18×add-exp-log
18×add-cbrt-cube
15×associate-/r*
13×associate-*l*
11×div-inv
div-exp
cbrt-undiv
pow1
add-log-exp
frac-2neg
clear-num
cbrt-unprod
prod-exp
associate-/l/
*-commutative
associate-*l/
pow-prod-down
associate-*r*
Counts
4 → 269
Calls
4 calls:
Slowest
11.0ms
(/ (/ (cos th) (sqrt (sqrt 2))) (sqrt (sqrt 2)))
6.0ms
(* (/ (cos th) (sqrt 2)) (* a2 a2))
4.0ms
(/ (cos th) (sqrt 2))
4.0ms
(/ (cos th) (sqrt (sqrt 2)))

series252.0ms

Counts
4 → 12
Calls
4 calls:
Slowest
105.0ms
(* (/ (cos th) (sqrt 2)) (* a2 a2))
73.0ms
(/ (cos th) (sqrt (sqrt 2)))
41.0ms
(/ (cos th) (sqrt 2))
32.0ms
(/ (/ (cos th) (sqrt (sqrt 2))) (sqrt (sqrt 2)))

simplify8.3s

Counts
397 → 281
Calls
397 calls:
Slowest
419.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))))
412.0ms
(* (* (* (/ (cos th) (sqrt 2)) (/ (cos th) (sqrt 2))) (/ (cos th) (sqrt 2))) (* (* (* a2 a2) (* a2 a2)) (* a2 a2)))
335.0ms
(- (/ (pow a2 2) (sqrt 2)) (* 1/2 (/ (* (pow a2 2) (pow th 2)) (sqrt 2))))
253.0ms
(/ (* (* (cos th) (cos th)) (cos th)) (* (* (sqrt 2) (sqrt 2)) (sqrt 2)))
225.0ms
(/ (/ (* (cbrt (cos th)) (cbrt (cos th))) (* (cbrt (sqrt (sqrt 2))) (cbrt (sqrt (sqrt 2))))) 1)

prune4.1s

Pruning

14 alts after pruning (14 fresh and 0 done)

Merged error: 0b

localize12.0ms

Local error

Found 4 expressions with local error:

0.7b
(/ (/ (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))) (* a1 a1))
0.3b
(/ (* (cos th) (* a2 a2)) (sqrt 2))

rewrite52.0ms

Algorithm
rewrite-expression-head
Rules
519×times-frac
281×add-cube-cbrt
281×*-un-lft-identity
281×add-sqr-sqrt
264×sqrt-prod
136×associate-*l*
26×associate-/l*
25×add-exp-log
25×add-cbrt-cube
17×div-inv
15×associate-/r*
div-exp
cbrt-undiv
pow1
add-log-exp
cbrt-unprod
prod-exp
frac-2neg
clear-num
associate-/l/
*-commutative
associate-*l/
pow-prod-down
associate-*r*
Counts
4 → 388
Calls
4 calls:
Slowest
12.0ms
(/ (* (cos th) (* a2 a2)) (sqrt 2))
11.0ms
(* (/ (/ (cos th) (sqrt (sqrt 2))) (sqrt (sqrt 2))) (* a1 a1))
7.0ms
(/ (/ (cos th) (sqrt (sqrt 2))) (sqrt (sqrt 2)))
4.0ms
(/ (cos th) (sqrt (sqrt 2)))

series320.0ms

Counts
4 → 12
Calls
4 calls:
Slowest
107.0ms
(/ (* (cos th) (* a2 a2)) (sqrt 2))
92.0ms
(* (/ (/ (cos th) (sqrt (sqrt 2))) (sqrt (sqrt 2))) (* a1 a1))
70.0ms
(/ (cos th) (sqrt (sqrt 2)))
51.0ms
(/ (/ (cos th) (sqrt (sqrt 2))) (sqrt (sqrt 2)))

simplify13.1s

Counts
511 → 400
Calls
511 calls:
Slowest
525.0ms
(* (* (* (/ (/ (cos th) (sqrt (sqrt 2))) (sqrt (sqrt 2))) (/ (/ (cos th) (sqrt (sqrt 2))) (sqrt (sqrt 2)))) (/ (/ (cos th) (sqrt (sqrt 2))) (sqrt (sqrt 2)))) (* (* (* a1 a1) (* a1 a1)) (* a1 a1)))
471.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))))
329.0ms
(+ (log (/ (/ (cos th) (sqrt (sqrt 2))) (sqrt (sqrt 2)))) (log (* a1 a1)))
309.0ms
(+ (- (- (log (cos th)) (log (sqrt (sqrt 2)))) (log (sqrt (sqrt 2)))) (log (* a1 a1)))
275.0ms
(- (/ (pow a2 2) (sqrt 2)) (* 1/2 (/ (* (pow a2 2) (pow th 2)) (sqrt 2))))

prune6.0s

Pruning

10 alts after pruning (10 fresh and 0 done)

Merged error: 0b

localize18.0ms

Local error

Found 4 expressions with local error:

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

rewrite71.0ms

Algorithm
rewrite-expression-head
Rules
519×times-frac
281×add-cube-cbrt
281×*-un-lft-identity
281×add-sqr-sqrt
264×sqrt-prod
136×associate-*l*
26×associate-/l*
17×div-inv
16×add-exp-log
16×add-cbrt-cube
15×associate-/r*
div-exp
cbrt-undiv
add-log-exp
pow1
frac-2neg
clear-num
associate-/l/
cbrt-unprod
*-commutative
prod-exp
associate-*l/
Counts
4 → 380
Calls
4 calls:
Slowest
23.0ms
(* (/ (/ (cos th) (sqrt (sqrt 2))) (sqrt (sqrt 2))) a1)
15.0ms
(/ (/ (cos th) (sqrt (sqrt 2))) (sqrt (sqrt 2)))
13.0ms
(/ (* (cos th) (* a2 a2)) (sqrt 2))
7.0ms
(/ (cos th) (sqrt (sqrt 2)))

series309.0ms

Counts
4 → 12
Calls
4 calls:
Slowest
107.0ms
(/ (* (cos th) (* a2 a2)) (sqrt 2))
91.0ms
(* (/ (/ (cos th) (sqrt (sqrt 2))) (sqrt (sqrt 2))) a1)
74.0ms
(/ (cos th) (sqrt (sqrt 2)))
37.0ms
(/ (/ (cos th) (sqrt (sqrt 2))) (sqrt (sqrt 2)))

simplify11.4s

Counts
504 → 392
Calls
504 calls:
Slowest
436.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))))
361.0ms
(- (/ a1 (sqrt 2)) (* 1/2 (/ (* a1 (pow th 2)) (sqrt 2))))
284.0ms
(- (/ (pow a2 2) (sqrt 2)) (* 1/2 (/ (* (pow a2 2) (pow th 2)) (sqrt 2))))
242.0ms
(/ (/ (* (cbrt (cos th)) (cbrt (cos th))) (* (cbrt (sqrt (sqrt 2))) (cbrt (sqrt (sqrt 2))))) (sqrt 1))
230.0ms
(/ (/ (* (cbrt (cos th)) (cbrt (cos th))) (* (cbrt (sqrt (sqrt 2))) (cbrt (sqrt (sqrt 2))))) (sqrt 1))

prune6.5s

Pruning

8 alts after pruning (8 fresh and 0 done)

Merged error: 0b

regimes512.0ms

Accuracy

0% (0.4b remaining)

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

bsearch3.0ms

end0.0ms

sample8.2s

Algorithm
intervals