Average Error: 12.6 → 9.0
Time: 32.1s
Precision: 64
Internal Precision: 128
\[\frac{\sin ky}{\sqrt{{\left(\sin kx\right)}^{2} + {\left(\sin ky\right)}^{2}}} \cdot \sin th\]
\[\sin th \cdot \frac{1}{\frac{\sqrt{\left(\sin kx\right)^2 + \left(\sin ky\right)^2}^*}{\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.6

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

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

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

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

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

Reproduce

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

sample471.0ms

Algorithm
intervals
Results
220.0ms92×body1280valid
113.0ms48×body640valid
27.0ms79×body80valid
25.0ms28×body320valid
5.0msbody160valid

simplify15.0ms

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

prune57.0ms

Pruning

2 alts after pruning (2 fresh and 0 done)

Merged error: 8.7b

localize44.0ms

Local error

Found 3 expressions with local error:

2.0b
(/ (* (sin th) (sin ky)) (hypot (sin kx) (sin ky)))
0.1b
(* (sin th) (sin ky))
0.1b
(hypot (sin kx) (sin ky))

rewrite25.0ms

Algorithm
rewrite-expression-head
Rules
10×add-exp-log
10×add-cbrt-cube
add-cube-cbrt
*-un-lft-identity
add-sqr-sqrt
pow1
add-log-exp
log1p-expm1-u
associate-*l*
associate-*r*
times-frac
associate-/r*
expm1-log1p-u
sin-mult
cbrt-unprod
prod-exp
div-exp
cbrt-undiv
associate-/l/
associate-/l*
div-inv
*-commutative
pow-prod-down
frac-2neg
clear-num
hypot-udef
Counts
3 → 54
Calls
3 calls:
Slowest
14.0ms
(/ (* (sin th) (sin ky)) (hypot (sin kx) (sin ky)))
7.0ms
(* (sin th) (sin ky))
0.0ms
(hypot (sin kx) (sin ky))

series481.0ms

Counts
3 → 9
Calls
3 calls:
Slowest
294.0ms
(/ (* (sin th) (sin ky)) (hypot (sin kx) (sin ky)))
135.0ms
(hypot (sin kx) (sin ky))
51.0ms
(* (sin th) (sin ky))

simplify1.7s

Counts
33 → 63
Calls
33 calls:
Slowest
564.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))))
491.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))))
380.0ms
(- (+ (* 1/12 (* (pow kx 2) ky)) ky) (* 1/6 (pow ky 3)))
71.0ms
(* (* (* (sin th) (sin th)) (sin th)) (* (* (sin ky) (sin ky)) (sin ky)))
36.0ms
(- (log (* (sin th) (sin ky))) (log (hypot (sin kx) (sin ky))))

prune780.0ms

Pruning

16 alts after pruning (16 fresh and 0 done)

Merged error: 7.3b

localize11.0ms

Local error

Found 3 expressions with local error:

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

rewrite18.0ms

Algorithm
rewrite-expression-head
Rules
19×add-cube-cbrt
19×*-un-lft-identity
19×add-sqr-sqrt
18×times-frac
13×associate-*r*
10×add-exp-log
10×add-cbrt-cube
pow1
add-log-exp
associate-/l*
log1p-expm1-u
associate-*l*
associate-/r*
expm1-log1p-u
div-inv
cbrt-unprod
prod-exp
div-exp
cbrt-undiv
*-commutative
associate-*r/
pow-prod-down
frac-2neg
clear-num
hypot-udef
Counts
3 → 71
Calls
3 calls:
Slowest
10.0ms
(* (sin th) (/ (sin ky) (hypot (sin kx) (sin ky))))
7.0ms
(/ (sin ky) (hypot (sin kx) (sin ky)))
0.0ms
(hypot (sin kx) (sin ky))

series599.0ms

Counts
3 → 9
Calls
3 calls:
Slowest
301.0ms
(* (sin th) (/ (sin ky) (hypot (sin kx) (sin ky))))
179.0ms
(/ (sin ky) (hypot (sin kx) (sin ky)))
119.0ms
(hypot (sin kx) (sin ky))

simplify1.8s

Counts
55 → 80
Calls
55 calls:
Slowest
512.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)))))
408.0ms
(- (+ (* 1/12 (* (pow kx 2) ky)) ky) (* 1/6 (pow ky 3)))
195.0ms
(- (+ (* 1/6 (* kx ky)) (* 7/360 (* (pow kx 3) ky))) (* 71/720 (* kx (pow ky 3))))
148.0ms
(* (* (* (sin th) (sin th)) (sin th)) (* (* (/ (sin ky) (hypot (sin kx) (sin ky))) (/ (sin ky) (hypot (sin kx) (sin ky)))) (/ (sin ky) (hypot (sin kx) (sin ky)))))
116.0ms
(/ (* (* (sin ky) (sin ky)) (sin ky)) (* (* (hypot (sin kx) (sin ky)) (hypot (sin kx) (sin ky))) (hypot (sin kx) (sin ky))))

prune1.0s

Pruning

21 alts after pruning (21 fresh and 0 done)

Merged error: 7.3b

localize10.0ms

Local error

Found 3 expressions with local error:

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

rewrite19.0ms

Algorithm
rewrite-expression-head
Rules
19×add-cube-cbrt
19×*-un-lft-identity
19×add-sqr-sqrt
18×times-frac
13×associate-*r*
10×add-exp-log
10×add-cbrt-cube
pow1
add-log-exp
associate-/l*
log1p-expm1-u
associate-*l*
associate-/r*
expm1-log1p-u
div-inv
cbrt-unprod
prod-exp
div-exp
cbrt-undiv
*-commutative
associate-*r/
pow-prod-down
frac-2neg
clear-num
hypot-udef
Counts
3 → 71
Calls
3 calls:
Slowest
11.0ms
(* (sin th) (/ (sin ky) (hypot (sin ky) (sin kx))))
7.0ms
(/ (sin ky) (hypot (sin ky) (sin kx)))
0.0ms
(hypot (sin ky) (sin kx))

series589.0ms

Counts
3 → 9
Calls
3 calls:
Slowest
261.0ms
(* (sin th) (/ (sin ky) (hypot (sin ky) (sin kx))))
193.0ms
(/ (sin ky) (hypot (sin ky) (sin kx)))
136.0ms
(hypot (sin ky) (sin kx))

simplify1.6s

Counts
55 → 80
Calls
55 calls:
Slowest
534.0ms
(* (* (* (sin th) (sin th)) (sin th)) (/ (* (* (sin ky) (sin ky)) (sin ky)) (* (* (hypot (sin ky) (sin kx)) (hypot (sin ky) (sin kx))) (hypot (sin ky) (sin kx)))))
312.0ms
(- (+ (* 1/12 (* kx (pow ky 2))) kx) (* 1/6 (pow kx 3)))
175.0ms
(- (+ (* 1/6 (* kx ky)) (* 7/360 (* (pow kx 3) ky))) (* 71/720 (* kx (pow ky 3))))
129.0ms
(* (* (* (sin th) (sin th)) (sin th)) (* (* (/ (sin ky) (hypot (sin ky) (sin kx))) (/ (sin ky) (hypot (sin ky) (sin kx)))) (/ (sin ky) (hypot (sin ky) (sin kx)))))
117.0ms
(/ (* (* (sin ky) (sin ky)) (sin ky)) (* (* (hypot (sin ky) (sin kx)) (hypot (sin ky) (sin kx))) (hypot (sin ky) (sin kx))))

prune1.1s

Pruning

21 alts after pruning (20 fresh and 1 done)

Merged error: 7.3b

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

rewrite10.0ms

Algorithm
rewrite-expression-head
Rules
84×times-frac
53×add-cube-cbrt
53×*-un-lft-identity
53×add-sqr-sqrt
16×associate-/r*
10×add-exp-log
10×add-cbrt-cube
associate-/l*
div-inv
div-exp
cbrt-undiv
add-log-exp
log1p-expm1-u
pow1
expm1-log1p-u
frac-2neg
clear-num
associate-/r/
hypot-udef
Counts
3 → 111
Calls
3 calls:
Slowest
5.0ms
(/ (sin th) (/ (hypot (sin kx) (sin ky)) (sin ky)))
3.0ms
(/ (hypot (sin kx) (sin ky)) (sin ky))
0.0ms
(hypot (sin kx) (sin ky))

series572.0ms

Counts
3 → 9
Calls
3 calls:
Slowest
260.0ms
(/ (sin th) (/ (hypot (sin kx) (sin ky)) (sin ky)))
185.0ms
(/ (hypot (sin kx) (sin ky)) (sin ky))
126.0ms
(hypot (sin kx) (sin ky))

simplify3.8s

Counts
132 → 120
Calls
132 calls:
Slowest
390.0ms
(- (+ (* 1/12 (* (pow kx 2) ky)) ky) (* 1/6 (pow ky 3)))
341.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))))
324.0ms
(/ (* (cbrt (sin th)) (cbrt (sin th))) (/ 1 (* (cbrt (sin ky)) (cbrt (sin ky)))))
299.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)))))
247.0ms
(/ (* (cbrt (sin th)) (cbrt (sin th))) (/ (* (cbrt (hypot (sin kx) (sin ky))) (cbrt (hypot (sin kx) (sin ky)))) 1))

prune1.6s

Pruning

21 alts after pruning (21 fresh and 0 done)

Merged error: 7.3b

regimes943.0ms

Accuracy

0% (0.2b remaining)

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

bsearch1.0ms

end0.0ms

sample12.2s

Algorithm
intervals
Results
7.8s2733×body1280valid
2.5s1845×body640valid
731.0ms2323×body80valid
696.0ms778×body320valid
176.0ms321×body160valid