Average Error: 12.1 → 12.2
Time: 36.3s
Precision: 64
Internal Precision: 128
\[\frac{\sin ky}{\sqrt{{\left(\sin kx\right)}^{2} + {\left(\sin ky\right)}^{2}}} \cdot \sin th\]
\[\sin ky \cdot \left(\sin th \cdot \frac{1}{\sqrt{{\left(\sin ky\right)}^{2} + {\left(\sin kx\right)}^{2}}}\right)\]

Error

Bits error versus kx

Bits error versus ky

Bits error versus th

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 12.1

    \[\frac{\sin ky}{\sqrt{{\left(\sin kx\right)}^{2} + {\left(\sin ky\right)}^{2}}} \cdot \sin th\]
  2. Using strategy rm
  3. Applied div-inv12.1

    \[\leadsto \color{blue}{\left(\sin ky \cdot \frac{1}{\sqrt{{\left(\sin kx\right)}^{2} + {\left(\sin ky\right)}^{2}}}\right)} \cdot \sin th\]
  4. Applied associate-*l*12.2

    \[\leadsto \color{blue}{\sin ky \cdot \left(\frac{1}{\sqrt{{\left(\sin kx\right)}^{2} + {\left(\sin ky\right)}^{2}}} \cdot \sin th\right)}\]
  5. Final simplification12.2

    \[\leadsto \sin ky \cdot \left(\sin th \cdot \frac{1}{\sqrt{{\left(\sin ky\right)}^{2} + {\left(\sin kx\right)}^{2}}}\right)\]

Reproduce

herbie shell --seed 2019016 
(FPCore (kx ky th)
  :name "Toniolo and Linder, Equation (3b), real"
  (* (/ (sin ky) (sqrt (+ (pow (sin kx) 2) (pow (sin ky) 2)))) (sin th)))

Details

Time bar (total: 31.6s)Debug log

sample432.0ms

Algorithm
intervals
Results
256×(pre true 80)
93×(body real 1280)
82×(body real 80)
53×(body real 640)
17×(body real 320)
11×(body real 160)

simplify52.0ms

Counts
1 → 1
Calls
1 calls:
Slowest
51.0ms
(* (/ (sin ky) (sqrt (+ (pow (sin kx) 2) (pow (sin ky) 2)))) (sin th))

prune23.0ms

Pruning

1 alts after pruning (1 fresh and 0 done)

Merged error: 11.2b

localize51.0ms

Local error

Found 4 expressions with local error:

2.3b
(sqrt (+ (pow (sin kx) 2) (pow (sin ky) 2)))
0.3b
(pow (sin ky) 2)
0.2b
(pow (sin kx) 2)
0.2b
(* (/ (sin ky) (sqrt (+ (pow (sin kx) 2) (pow (sin ky) 2)))) (sin th))

rewrite466.0ms

Algorithm
rewrite-expression-head
Rules
39×*-un-lft-identity
30×associate-*l*
24×times-frac
24×add-sqr-sqrt
23×add-cube-cbrt
20×sqrt-prod
14×unpow-prod-down
11×add-exp-log
add-cbrt-cube
distribute-lft-out
pow1
add-log-exp
sqrt-div
associate-*r*
unpow2
flip-+
cbrt-unprod
associate-/r/
prod-exp
pow-exp
flip3-+
pow-pow
pow-to-exp
div-inv
*-commutative
associate-*l/
pow-prod-down
div-exp
pow1/2
rem-sqrt-square
cbrt-undiv
Counts
4 → 91
Calls
4 calls:
Slowest
15.0ms
(* (/ (sin ky) (sqrt (+ (pow (sin kx) 2) (pow (sin ky) 2)))) (sin th))
9.0ms
(sqrt (+ (pow (sin kx) 2) (pow (sin ky) 2)))
1.0ms
(pow (sin ky) 2)
1.0ms
(pow (sin kx) 2)

series325.0ms

Counts
4 → 12
Calls
4 calls:
Slowest
182.0ms
(* (/ (sin ky) (sqrt (+ (pow (sin kx) 2) (pow (sin ky) 2)))) (sin th))
108.0ms
(sqrt (+ (pow (sin kx) 2) (pow (sin ky) 2)))
19.0ms
(pow (sin kx) 2)
15.0ms
(pow (sin ky) 2)

simplify1.9s

Counts
68 → 103
Calls
68 calls:
Slowest
610.0ms
(* (/ (* (* (sin ky) (sin ky)) (sin ky)) (* (* (sqrt (+ (pow (sin kx) 2) (pow (sin ky) 2))) (sqrt (+ (pow (sin kx) 2) (pow (sin ky) 2)))) (sqrt (+ (pow (sin kx) 2) (pow (sin ky) 2))))) (* (* (sin th) (sin th)) (sin th)))
195.0ms
(- (+ (* 1/12 (* (pow kx 2) ky)) ky) (* 1/6 (pow ky 3)))
191.0ms
(* (* (* (/ (sin ky) (sqrt (+ (pow (sin kx) 2) (pow (sin ky) 2)))) (/ (sin ky) (sqrt (+ (pow (sin kx) 2) (pow (sin ky) 2))))) (/ (sin ky) (sqrt (+ (pow (sin kx) 2) (pow (sin ky) 2))))) (* (* (sin th) (sin th)) (sin th)))
145.0ms
(sqrt (- (* (pow (sin kx) 2) (pow (sin kx) 2)) (* (pow (sin ky) 2) (pow (sin ky) 2))))
93.0ms
(/ (sin ky) (sqrt (- (* (pow (sin kx) 2) (pow (sin kx) 2)) (* (pow (sin ky) 2) (pow (sin ky) 2)))))

prune1.7s

Pruning

22 alts after pruning (22 fresh and 0 done)

Merged error: 10.5b

localize9.0ms

Local error

Found 4 expressions with local error:

2.3b
(sqrt (+ (pow (sin kx) 2) (pow (sin ky) 2)))
0.3b
(* (/ 1 (sqrt (+ (pow (sin kx) 2) (pow (sin ky) 2)))) (sin th))
0.3b
(* (sin ky) (* (/ 1 (sqrt (+ (pow (sin kx) 2) (pow (sin ky) 2)))) (sin th)))
0.3b
(pow (sin ky) 2)

rewrite26.0ms

Algorithm
rewrite-expression-head
Rules
17×add-exp-log
13×*-un-lft-identity
12×pow1
11×add-cbrt-cube
10×add-sqr-sqrt
add-cube-cbrt
associate-*l*
prod-exp
sqrt-prod
unpow-prod-down
add-log-exp
cbrt-unprod
pow-prod-down
associate-*r*
sqrt-div
distribute-lft-out
flip-+
*-commutative
associate-/r/
associate-*l/
flip3-+
rec-exp
unpow2
div-inv
associate-*r/
pow-exp
pow1/2
pow-pow
rem-sqrt-square
pow-to-exp
Counts
4 → 72
Calls
4 calls:
Slowest
12.0ms
(* (sin ky) (* (/ 1 (sqrt (+ (pow (sin kx) 2) (pow (sin ky) 2)))) (sin th)))
7.0ms
(sqrt (+ (pow (sin kx) 2) (pow (sin ky) 2)))
5.0ms
(* (/ 1 (sqrt (+ (pow (sin kx) 2) (pow (sin ky) 2)))) (sin th))
1.0ms
(pow (sin ky) 2)

series473.0ms

Counts
4 → 12
Calls
4 calls:
Slowest
205.0ms
(* (/ 1 (sqrt (+ (pow (sin kx) 2) (pow (sin ky) 2)))) (sin th))
162.0ms
(* (sin ky) (* (/ 1 (sqrt (+ (pow (sin kx) 2) (pow (sin ky) 2)))) (sin th)))
91.0ms
(sqrt (+ (pow (sin kx) 2) (pow (sin ky) 2)))
15.0ms
(pow (sin ky) 2)

simplify2.6s

Counts
48 → 84
Calls
48 calls:
Slowest
535.0ms
(* (* (* (sin ky) (sin ky)) (sin ky)) (* (* (* (/ 1 (sqrt (+ (pow (sin kx) 2) (pow (sin ky) 2)))) (sin th)) (* (/ 1 (sqrt (+ (pow (sin kx) 2) (pow (sin ky) 2)))) (sin th))) (* (/ 1 (sqrt (+ (pow (sin kx) 2) (pow (sin ky) 2)))) (sin th))))
411.0ms
(* (* (* (/ 1 (sqrt (+ (pow (sin kx) 2) (pow (sin ky) 2)))) (/ 1 (sqrt (+ (pow (sin kx) 2) (pow (sin ky) 2))))) (/ 1 (sqrt (+ (pow (sin kx) 2) (pow (sin ky) 2))))) (* (* (sin th) (sin th)) (sin th)))
322.0ms
(* (* (* (sin ky) (sin ky)) (sin ky)) (* (* (* (/ 1 (sqrt (+ (pow (sin kx) 2) (pow (sin ky) 2)))) (/ 1 (sqrt (+ (pow (sin kx) 2) (pow (sin ky) 2))))) (/ 1 (sqrt (+ (pow (sin kx) 2) (pow (sin ky) 2))))) (* (* (sin th) (sin th)) (sin th))))
229.0ms
(- (+ (* 1/12 (* (pow kx 2) ky)) ky) (* 1/6 (pow ky 3)))
148.0ms
(/ 1 (sqrt (- (* (pow (sin kx) 2) (pow (sin kx) 2)) (* (pow (sin ky) 2) (pow (sin ky) 2)))))

prune1.5s

Pruning

26 alts after pruning (25 fresh and 1 done)

Merged error: 10.5b

localize6.0ms

Local error

Found 4 expressions with local error:

2.3b
(sqrt (+ (pow (sin kx) 2) (pow (sin ky) 2)))
0.3b
(* (sin ky) (/ 1 (sqrt (+ (pow (sin kx) 2) (pow (sin ky) 2)))))
0.3b
(pow (sin ky) 2)
0.2b
(pow (sin kx) 2)

rewrite15.0ms

Algorithm
rewrite-expression-head
Rules
13×*-un-lft-identity
10×add-exp-log
10×add-sqr-sqrt
add-cube-cbrt
unpow-prod-down
pow1
associate-*r*
add-cbrt-cube
sqrt-prod
add-log-exp
sqrt-div
associate-*l*
unpow2
distribute-lft-out
flip-+
associate-/r/
prod-exp
pow-exp
flip3-+
pow-pow
pow-to-exp
div-inv
cbrt-unprod
*-commutative
un-div-inv
associate-*r/
pow-prod-down
pow1/2
rec-exp
rem-sqrt-square
Counts
4 → 67
Calls
4 calls:
Slowest
7.0ms
(sqrt (+ (pow (sin kx) 2) (pow (sin ky) 2)))
5.0ms
(* (sin ky) (/ 1 (sqrt (+ (pow (sin kx) 2) (pow (sin ky) 2)))))
1.0ms
(pow (sin ky) 2)
1.0ms
(pow (sin kx) 2)

series262.0ms

Counts
4 → 12
Calls
4 calls:
Slowest
138.0ms
(* (sin ky) (/ 1 (sqrt (+ (pow (sin kx) 2) (pow (sin ky) 2)))))
85.0ms
(sqrt (+ (pow (sin kx) 2) (pow (sin ky) 2)))
22.0ms
(pow (sin kx) 2)
17.0ms
(pow (sin ky) 2)

simplify1.1s

Counts
44 → 79
Calls
44 calls:
Slowest
335.0ms
(* (* (* (sin ky) (sin ky)) (sin ky)) (* (* (/ 1 (sqrt (+ (pow (sin kx) 2) (pow (sin ky) 2)))) (/ 1 (sqrt (+ (pow (sin kx) 2) (pow (sin ky) 2))))) (/ 1 (sqrt (+ (pow (sin kx) 2) (pow (sin ky) 2))))))
155.0ms
(sqrt (+ (* (pow (sin kx) 2) (pow (sin kx) 2)) (- (* (pow (sin ky) 2) (pow (sin ky) 2)) (* (pow (sin kx) 2) (pow (sin ky) 2)))))
153.0ms
(- (+ (* 1/12 (* (pow kx 2) ky)) ky) (* 1/6 (pow ky 3)))
108.0ms
(sqrt (- (* (pow (sin kx) 2) (pow (sin kx) 2)) (* (pow (sin ky) 2) (pow (sin ky) 2))))
63.0ms
(sqrt (+ (pow (pow (sin kx) 2) 3) (pow (pow (sin ky) 2) 3)))

prune1.3s

Pruning

27 alts after pruning (26 fresh and 1 done)

Merged error: 10.5b

localize28.0ms

Local error

Found 4 expressions with local error:

2.3b
(sqrt (+ (pow (sin kx) 2) (pow (sin ky) 2)))
2.3b
(sqrt (+ (pow (sin kx) 2) (pow (sin ky) 2)))
2.3b
(sqrt (+ (pow (sin kx) 2) (pow (sin ky) 2)))
0.4b
(cbrt (/ (sin ky) (sqrt (+ (pow (sin kx) 2) (pow (sin ky) 2)))))

rewrite34.0ms

Algorithm
rewrite-expression-head
Rules
46×*-un-lft-identity
30×sqrt-prod
30×cbrt-prod
25×add-sqr-sqrt
24×times-frac
22×add-cube-cbrt
12×distribute-lft-out
12×unpow-prod-down
sqrt-div
add-log-exp
flip-+
add-exp-log
add-cbrt-cube
flip3-+
pow1
pow1/2
rem-sqrt-square
associate-/r/
div-inv
pow1/3
cbrt-div
Counts
4 → 87
Calls
4 calls:
Slowest
10.0ms
(cbrt (/ (sin ky) (sqrt (+ (pow (sin kx) 2) (pow (sin ky) 2)))))
8.0ms
(sqrt (+ (pow (sin kx) 2) (pow (sin ky) 2)))
7.0ms
(sqrt (+ (pow (sin kx) 2) (pow (sin ky) 2)))
7.0ms
(sqrt (+ (pow (sin kx) 2) (pow (sin ky) 2)))

series487.0ms

Counts
4 → 12
Calls
4 calls:
Slowest
222.0ms
(cbrt (/ (sin ky) (sqrt (+ (pow (sin kx) 2) (pow (sin ky) 2)))))
97.0ms
(sqrt (+ (pow (sin kx) 2) (pow (sin ky) 2)))
87.0ms
(sqrt (+ (pow (sin kx) 2) (pow (sin ky) 2)))
80.0ms
(sqrt (+ (pow (sin kx) 2) (pow (sin ky) 2)))

simplify1.8s

Counts
67 → 99
Calls
67 calls:
Slowest
211.0ms
(- (+ (exp (* 1/3 (- (log ky) (log kx)))) (* 1/18 (* (pow kx 2) (exp (* 1/3 (- (log ky) (log kx))))))) (+ (* 1/18 (* (pow ky 2) (exp (* 1/3 (- (log ky) (log kx)))))) (* 1/6 (* (exp (* 1/3 (- (log ky) (* 7 (log kx))))) (pow ky 2)))))
185.0ms
(- (+ (* 1/12 (* (pow kx 2) ky)) ky) (* 1/6 (pow ky 3)))
169.0ms
(- (+ (* 1/12 (* (pow kx 2) ky)) ky) (* 1/6 (pow ky 3)))
155.0ms
(- (+ (* 1/12 (* (pow kx 2) ky)) ky) (* 1/6 (pow ky 3)))
135.0ms
(cbrt (/ (sin ky) (sqrt (- (* (pow (sin kx) 2) (pow (sin kx) 2)) (* (pow (sin ky) 2) (pow (sin ky) 2))))))

prune2.1s

Pruning

28 alts after pruning (27 fresh and 1 done)

Merged error: 10.5b

regimes2.5s

Accuracy

0% (1.3b remaining)

Error of 12.2b against oracle of 10.9b and baseline of 12.2b

bsearch4.0ms

end0.0ms

sample12.2s

Algorithm
intervals
Results
8000×(pre true 80)
2775×(body real 1280)
2295×(body real 80)
1777×(body real 640)
799×(body real 320)
354×(body real 160)