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

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.5

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

    \[\leadsto \color{blue}{\frac{\sin th \cdot \sin ky}{\sqrt{\left(\sin kx\right)^2 + \left(\sin ky\right)^2}^*}}\]
  3. Using strategy rm
  4. Applied associate-/l*8.8

    \[\leadsto \color{blue}{\frac{\sin th}{\frac{\sqrt{\left(\sin kx\right)^2 + \left(\sin ky\right)^2}^*}{\sin ky}}}\]
  5. Using strategy rm
  6. Applied div-inv8.9

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

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

Reproduce

herbie shell --seed 2019002 +o rules:numerics
(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.7s)Debug log

sample512.0ms

Algorithm
intervals

simplify28.0ms

Counts
1 → 1
Calls

1 calls. Slowest were:

27.0ms
(* (/ (sin ky) (sqrt (+ (pow (sin kx) 2) (pow (sin ky) 2)))) (sin th))

prune18.0ms

Pruning

2 alts after pruning (2 fresh and 0 done)

Merged error: 10.8b

localize56.0ms

Local error

Found 3 expressions with local error:

3.0b
(/ (* (sin th) (sin ky)) (hypot (sin kx) (sin ky)))
0.3b
(* (sin th) (sin ky))
0.0b
(hypot (sin kx) (sin ky))

rewrite14.0ms

Algorithm
rewrite-expression-head
Counts
3 → 54
Calls

3 calls. Slowest were:

8.0ms
(/ (* (sin th) (sin ky)) (hypot (sin kx) (sin ky)))
4.0ms
(* (sin th) (sin ky))
0.0ms
(hypot (sin kx) (sin ky))

series524.0ms

Counts
3 → 9
Calls

3 calls. Slowest were:

313.0ms
(/ (* (sin th) (sin ky)) (hypot (sin kx) (sin ky)))
134.0ms
(hypot (sin kx) (sin ky))
77.0ms
(* (sin th) (sin ky))

simplify2.0s

Counts
33 → 63
Calls

33 calls. Slowest were:

601.0ms
(/ (* (* (* (sin th) (sin th)) (sin th)) (* (* (sin ky) (sin ky)) (sin ky))) (* (* (hypot (sin kx) (sin ky)) (hypot (sin kx) (sin ky))) (hypot (sin kx) (sin ky))))
582.0ms
(/ (* (* (* (sin th) (sin ky)) (* (sin th) (sin ky))) (* (sin th) (sin ky))) (* (* (hypot (sin kx) (sin ky)) (hypot (sin kx) (sin ky))) (hypot (sin kx) (sin ky))))
481.0ms
(- (+ (* 1/12 (* (pow kx 2) ky)) ky) (* 1/6 (pow ky 3)))

prune900.0ms

Pruning

18 alts after pruning (18 fresh and 0 done)

Merged error: 9.1b

localize11.0ms

Local error

Found 3 expressions with local error:

0.2b
(/ (sin th) (/ (hypot (sin kx) (sin ky)) (sin ky)))
0.1b
(/ (hypot (sin kx) (sin ky)) (sin ky))
0.0b
(hypot (sin kx) (sin ky))

rewrite21.0ms

Algorithm
rewrite-expression-head
Counts
3 → 111
Calls

3 calls. Slowest were:

10.0ms
(/ (sin th) (/ (hypot (sin kx) (sin ky)) (sin ky)))
7.0ms
(/ (hypot (sin kx) (sin ky)) (sin ky))
0.0ms
(hypot (sin kx) (sin ky))

series629.0ms

Counts
3 → 9
Calls

3 calls. Slowest were:

247.0ms
(/ (hypot (sin kx) (sin ky)) (sin ky))
230.0ms
(/ (sin th) (/ (hypot (sin kx) (sin ky)) (sin ky)))
152.0ms
(hypot (sin kx) (sin ky))

simplify4.4s

Counts
132 → 120
Calls

132 calls. Slowest were:

436.0ms
(- (+ (* 1/12 (* (pow kx 2) ky)) ky) (* 1/6 (pow ky 3)))
421.0ms
(/ (* (* (sin th) (sin th)) (sin th)) (/ (* (* (hypot (sin kx) (sin ky)) (hypot (sin kx) (sin ky))) (hypot (sin kx) (sin ky))) (* (* (sin ky) (sin ky)) (sin ky))))
419.0ms
(/ (* (cbrt (sin th)) (cbrt (sin th))) (/ (* (cbrt (hypot (sin kx) (sin ky))) (cbrt (hypot (sin kx) (sin ky)))) (* (cbrt (sin ky)) (cbrt (sin ky)))))

prune1.9s

Pruning

23 alts after pruning (23 fresh and 0 done)

Merged error: 9.1b

localize17.0ms

Local error

Found 4 expressions with local error:

0.3b
(* (hypot (sin kx) (sin ky)) (/ 1 (sin ky)))
0.2b
(/ (sin th) (* (hypot (sin kx) (sin ky)) (/ 1 (sin ky))))
0.1b
(/ 1 (sin ky))
0.0b
(hypot (sin kx) (sin ky))

rewrite16.0ms

Algorithm
rewrite-expression-head
Counts
4 → 77
Calls

4 calls. Slowest were:

8.0ms
(* (hypot (sin kx) (sin ky)) (/ 1 (sin ky)))
6.0ms
(/ (sin th) (* (hypot (sin kx) (sin ky)) (/ 1 (sin ky))))
1.0ms
(/ 1 (sin ky))

series627.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

276.0ms
(/ (sin th) (* (hypot (sin kx) (sin ky)) (/ 1 (sin ky))))
186.0ms
(* (hypot (sin kx) (sin ky)) (/ 1 (sin ky)))
144.0ms
(hypot (sin kx) (sin ky))
20.0ms
(/ 1 (sin ky))

simplify1.6s

Counts
44 → 89
Calls

44 calls. Slowest were:

481.0ms
(- (+ (* 1/12 (* (pow kx 2) ky)) ky) (* 1/6 (pow ky 3)))
293.0ms
(* (* (* (hypot (sin kx) (sin ky)) (hypot (sin kx) (sin ky))) (hypot (sin kx) (sin ky))) (* (* (/ 1 (sin ky)) (/ 1 (sin ky))) (/ 1 (sin ky))))
135.0ms
(/ (* (* (sin th) (sin th)) (sin th)) (* (* (* (hypot (sin kx) (sin ky)) (hypot (sin kx) (sin ky))) (hypot (sin kx) (sin ky))) (* (* (/ 1 (sin ky)) (/ 1 (sin ky))) (/ 1 (sin ky)))))

prune1.4s

Pruning

24 alts after pruning (23 fresh and 1 done)

Merged error: 9.1b

localize28.0ms

Local error

Found 4 expressions with local error:

0.6b
(cbrt (sin ky))
0.6b
(cbrt (sin ky))
0.6b
(cbrt (sin ky))
0.6b
(cbrt (hypot (sin kx) (sin ky)))

rewrite5.0ms

Algorithm
rewrite-expression-head
Counts
4 → 52
Calls

4 calls. Slowest were:

1.0ms
(cbrt (sin ky))
1.0ms
(cbrt (sin ky))
1.0ms
(cbrt (hypot (sin kx) (sin ky)))

series715.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

193.0ms
(cbrt (hypot (sin kx) (sin ky)))
183.0ms
(cbrt (sin ky))
176.0ms
(cbrt (sin ky))
162.0ms
(cbrt (sin ky))

simplify572.0ms

Counts
24 → 64
Calls

24 calls. Slowest were:

164.0ms
(- (+ (* 1/6 (* (pow kx 2) (pow (/ 1 (pow ky 5)) 1/3))) (pow ky 1/3)) (* 1/18 (pow (pow ky 7) 1/3)))
122.0ms
(- (pow ky 1/3) (+ (* 1/3240 (pow (pow ky 13) 1/3)) (* 1/18 (pow (pow ky 7) 1/3))))
116.0ms
(- (pow ky 1/3) (+ (* 1/3240 (pow (pow ky 13) 1/3)) (* 1/18 (pow (pow ky 7) 1/3))))

prune1.2s

Pruning

26 alts after pruning (25 fresh and 1 done)

Merged error: 9.1b

regimes2.0s

Accuracy

0% (0.2b remaining)

Error of 8.9b against oracle of 8.7b and baseline of 8.9b

bsearch3.0ms

end0.0ms

sample12.6s

Algorithm
intervals