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

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

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

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

    \[\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 clear-num8.9

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

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

Reproduce

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

sample456.0ms

Algorithm
intervals

simplify28.0ms

Counts
1 → 1
Calls

1 calls. Slowest were:

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

prune28.0ms

Pruning

2 alts after pruning (2 fresh and 0 done)

Merged error: 10.9b

localize42.0ms

Local error

Found 3 expressions with local error:

1.6b
(/ (* (sin th) (sin ky)) (hypot (sin kx) (sin ky)))
0.2b
(* (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:

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

series550.0ms

Counts
3 → 9
Calls

3 calls. Slowest were:

334.0ms
(/ (* (sin th) (sin ky)) (hypot (sin kx) (sin ky)))
137.0ms
(hypot (sin kx) (sin ky))
78.0ms
(* (sin th) (sin ky))

simplify1.8s

Counts
33 → 63
Calls

33 calls. Slowest were:

554.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))))
493.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))))
405.0ms
(- (+ (* 1/12 (* (pow kx 2) ky)) ky) (* 1/6 (pow ky 3)))

prune819.0ms

Pruning

16 alts after pruning (16 fresh and 0 done)

Merged error: 10.2b

localize12.0ms

Local error

Found 3 expressions with local error:

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

rewrite23.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))
3.0ms
(hypot (sin kx) (sin ky))

series670.0ms

Counts
3 → 9
Calls

3 calls. Slowest were:

279.0ms
(/ (sin th) (/ (hypot (sin kx) (sin ky)) (sin ky)))
256.0ms
(/ (hypot (sin kx) (sin ky)) (sin ky))
135.0ms
(hypot (sin kx) (sin ky))

simplify4.2s

Counts
132 → 120
Calls

132 calls. Slowest were:

454.0ms
(- (+ (* 1/12 (* (pow kx 2) ky)) ky) (* 1/6 (pow ky 3)))
396.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))))
345.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.8s

Pruning

19 alts after pruning (19 fresh and 0 done)

Merged error: 10.1b

localize12.0ms

Local error

Found 3 expressions with local error:

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

rewrite24.0ms

Algorithm
rewrite-expression-head
Counts
3 → 71
Calls

3 calls. Slowest were:

16.0ms
(* (/ (sin th) (hypot (sin kx) (sin ky))) (sin ky))
7.0ms
(/ (sin th) (hypot (sin kx) (sin ky)))
0.0ms
(hypot (sin kx) (sin ky))

series681.0ms

Counts
3 → 9
Calls

3 calls. Slowest were:

276.0ms
(* (/ (sin th) (hypot (sin kx) (sin ky))) (sin ky))
258.0ms
(/ (sin th) (hypot (sin kx) (sin ky)))
147.0ms
(hypot (sin kx) (sin ky))

simplify1.6s

Counts
55 → 80
Calls

55 calls. Slowest were:

508.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)))
378.0ms
(- (+ (* 1/12 (* (pow kx 2) ky)) ky) (* 1/6 (pow ky 3)))
166.0ms
(* (* (* (/ (sin th) (hypot (sin kx) (sin ky))) (/ (sin th) (hypot (sin kx) (sin ky)))) (/ (sin th) (hypot (sin kx) (sin ky)))) (* (* (sin ky) (sin ky)) (sin ky)))

prune1.2s

Pruning

20 alts after pruning (20 fresh and 0 done)

Merged error: 10.1b

localize16.0ms

Local error

Found 4 expressions with local error:

0.4b
(/ 1 (/ (/ (hypot (sin kx) (sin ky)) (sin ky)) (sin th)))
0.2b
(/ (/ (hypot (sin kx) (sin ky)) (sin ky)) (sin th))
0.2b
(/ (hypot (sin kx) (sin ky)) (sin ky))
0.0b
(hypot (sin kx) (sin ky))

rewrite31.0ms

Algorithm
rewrite-expression-head
Counts
4 → 172
Calls

4 calls. Slowest were:

12.0ms
(/ (/ (hypot (sin kx) (sin ky)) (sin ky)) (sin th))
7.0ms
(/ (hypot (sin kx) (sin ky)) (sin ky))
6.0ms
(/ 1 (/ (/ (hypot (sin kx) (sin ky)) (sin ky)) (sin th)))

series911.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

263.0ms
(/ (hypot (sin kx) (sin ky)) (sin ky))
261.0ms
(/ 1 (/ (/ (hypot (sin kx) (sin ky)) (sin ky)) (sin th)))
237.0ms
(/ (/ (hypot (sin kx) (sin ky)) (sin ky)) (sin th))
150.0ms
(hypot (sin kx) (sin ky))

simplify4.3s

Counts
180 → 184
Calls

180 calls. Slowest were:

393.0ms
(/ (/ (* (* (hypot (sin kx) (sin ky)) (hypot (sin kx) (sin ky))) (hypot (sin kx) (sin ky))) (* (* (sin ky) (sin ky)) (sin ky))) (* (* (sin th) (sin th)) (sin th)))
361.0ms
(- (+ (* 1/12 (* (pow kx 2) ky)) ky) (* 1/6 (pow ky 3)))
300.0ms
(/ (/ (* (cbrt (hypot (sin kx) (sin ky))) (cbrt (hypot (sin kx) (sin ky)))) (* (cbrt (sin ky)) (cbrt (sin ky)))) (* (cbrt (sin th)) (cbrt (sin th))))

prune2.5s

Pruning

24 alts after pruning (23 fresh and 1 done)

Merged error: 10.1b

regimes1.2s

Accuracy

0% (0.4b remaining)

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

bsearch3.0ms

end0.0ms

sample13.2s

Algorithm
intervals