Average Error: 12.9 → 9.2
Time: 37.4s
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.9

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

    \[\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*9.1

    \[\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-inv9.2

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

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

Reproduce

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

sample380.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))

prune21.0ms

Pruning

2 alts after pruning (2 fresh and 0 done)

Merged error: 9.8b

localize51.0ms

Local error

Found 3 expressions with local error:

2.9b
(/ (* (sin th) (sin ky)) (hypot (sin kx) (sin ky)))
0.2b
(* (sin th) (sin ky))
0.1b
(hypot (sin kx) (sin ky))

rewrite26.0ms

Algorithm
rewrite-expression-head
Counts
3 → 54
Calls

3 calls. Slowest were:

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

series506.0ms

Counts
3 → 9
Calls

3 calls. Slowest were:

313.0ms
(/ (* (sin th) (sin ky)) (hypot (sin kx) (sin ky)))
137.0ms
(hypot (sin kx) (sin ky))
55.0ms
(* (sin th) (sin ky))

simplify1.7s

Counts
33 → 63
Calls

33 calls. Slowest were:

604.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))))
453.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))))
371.0ms
(- (+ (* 1/12 (* (pow kx 2) ky)) ky) (* 1/6 (pow ky 3)))

prune931.0ms

Pruning

17 alts after pruning (17 fresh and 0 done)

Merged error: 8.3b

localize5.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.1b
(hypot (sin kx) (sin ky))

rewrite11.0ms

Algorithm
rewrite-expression-head
Counts
3 → 111
Calls

3 calls. Slowest were:

5.0ms
(/ (sin th) (/ (hypot (sin kx) (sin ky)) (sin ky)))
5.0ms
(/ (hypot (sin kx) (sin ky)) (sin ky))
0.0ms
(hypot (sin kx) (sin ky))

series609.0ms

Counts
3 → 9
Calls

3 calls. Slowest were:

263.0ms
(/ (sin th) (/ (hypot (sin kx) (sin ky)) (sin ky)))
199.0ms
(/ (hypot (sin kx) (sin ky)) (sin ky))
147.0ms
(hypot (sin kx) (sin ky))

simplify4.4s

Counts
132 → 120
Calls

132 calls. Slowest were:

457.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)))))
381.0ms
(/ (* (cbrt (sin th)) (cbrt (sin th))) (/ 1 (* (cbrt (sin ky)) (cbrt (sin ky)))))
374.0ms
(- (+ (* 1/12 (* (pow kx 2) ky)) ky) (* 1/6 (pow ky 3)))

prune1.7s

Pruning

22 alts after pruning (22 fresh and 0 done)

Merged error: 8.3b

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.1b
(hypot (sin kx) (sin ky))

rewrite15.0ms

Algorithm
rewrite-expression-head
Counts
4 → 77
Calls

4 calls. Slowest were:

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

series647.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

279.0ms
(/ (sin th) (* (hypot (sin kx) (sin ky)) (/ 1 (sin ky))))
172.0ms
(hypot (sin kx) (sin ky))
171.0ms
(* (hypot (sin kx) (sin ky)) (/ 1 (sin ky)))
25.0ms
(/ 1 (sin ky))

simplify1.6s

Counts
44 → 89
Calls

44 calls. Slowest were:

379.0ms
(- (+ (* 1/12 (* (pow kx 2) ky)) ky) (* 1/6 (pow ky 3)))
337.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))))
130.0ms
(- (log (sin th)) (+ (log (hypot (sin kx) (sin ky))) (log (/ 1 (sin ky)))))

prune1.1s

Pruning

23 alts after pruning (22 fresh and 1 done)

Merged error: 8.3b

localize15.0ms

Local error

Found 4 expressions with local error:

0.4b
(/ (sin ky) (sqrt (hypot (sin kx) (sin ky))))
0.3b
(* (/ (sin th) (sqrt (hypot (sin kx) (sin ky)))) (/ (sin ky) (sqrt (hypot (sin kx) (sin ky)))))
0.3b
(/ (sin th) (sqrt (hypot (sin kx) (sin ky))))
0.1b
(sqrt (hypot (sin kx) (sin ky)))

rewrite27.0ms

Algorithm
rewrite-expression-head
Counts
4 → 162
Calls

4 calls. Slowest were:

13.0ms
(* (/ (sin th) (sqrt (hypot (sin kx) (sin ky)))) (/ (sin ky) (sqrt (hypot (sin kx) (sin ky)))))
7.0ms
(/ (sin ky) (sqrt (hypot (sin kx) (sin ky))))
4.0ms
(/ (sin th) (sqrt (hypot (sin kx) (sin ky))))

series879.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

284.0ms
(* (/ (sin th) (sqrt (hypot (sin kx) (sin ky)))) (/ (sin ky) (sqrt (hypot (sin kx) (sin ky)))))
227.0ms
(/ (sin th) (sqrt (hypot (sin kx) (sin ky))))
187.0ms
(/ (sin ky) (sqrt (hypot (sin kx) (sin ky))))
181.0ms
(sqrt (hypot (sin kx) (sin ky)))

simplify2.8s

Counts
164 → 174
Calls

164 calls. Slowest were:

519.0ms
(* (* (* (/ (sin th) (sqrt (hypot (sin kx) (sin ky)))) (/ (sin th) (sqrt (hypot (sin kx) (sin ky))))) (/ (sin th) (sqrt (hypot (sin kx) (sin ky))))) (* (* (/ (sin ky) (sqrt (hypot (sin kx) (sin ky)))) (/ (sin ky) (sqrt (hypot (sin kx) (sin ky))))) (/ (sin ky) (sqrt (hypot (sin kx) (sin ky))))))
387.0ms
(+ (- (log (sin th)) (log (sqrt (hypot (sin kx) (sin ky))))) (- (log (sin ky)) (log (sqrt (hypot (sin kx) (sin ky))))))
213.0ms
(+ (- (log (sin th)) (log (sqrt (hypot (sin kx) (sin ky))))) (log (/ (sin ky) (sqrt (hypot (sin kx) (sin ky))))))

prune2.5s

Pruning

24 alts after pruning (23 fresh and 1 done)

Merged error: 8.3b

regimes1.3s

Accuracy

0% (0.2b remaining)

Error of 9.2b against oracle of 9.0b and baseline of 9.2b

bsearch3.0ms

end0.0ms

sample12.6s

Algorithm
intervals