Average Error: 12.1 → 8.5
Time: 34.7s
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{\sin ky}{\sqrt{\left(\sin kx\right)^2 + \left(\sin ky\right)^2}^*}\]

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. Simplified10.8

    \[\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 *-un-lft-identity10.8

    \[\leadsto \frac{\sin th \cdot \sin ky}{\color{blue}{1 \cdot \sqrt{\left(\sin kx\right)^2 + \left(\sin ky\right)^2}^*}}\]
  5. Applied times-frac8.5

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

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

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

Reproduce

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

sample1.0s

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)

simplify488.0ms

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

prune19.0ms

Pruning

2 alts after pruning (2 fresh and 0 done)

Merged error: 9.6b

localize21.0ms

Local error

Found 3 expressions with local error:

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

rewrite13.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
8.0ms
(/ (* (sin th) (sin ky)) (hypot (sin kx) (sin ky)))
4.0ms
(* (sin th) (sin ky))
0.0ms
(hypot (sin kx) (sin ky))

series510.0ms

Counts
3 → 9
Calls
3 calls:
Slowest
286.0ms
(/ (* (sin th) (sin ky)) (hypot (sin kx) (sin ky)))
162.0ms
(hypot (sin kx) (sin ky))
61.0ms
(* (sin th) (sin ky))

simplify1.8s

Counts
33 → 63
Calls
33 calls:
Slowest
569.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))))
567.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))))
358.0ms
(- (+ (* 1/12 (* (pow kx 2) ky)) ky) (* 1/6 (pow ky 3)))
57.0ms
(* (* (* (sin th) (sin th)) (sin th)) (* (* (sin ky) (sin ky)) (sin ky)))
39.0ms
(* 1/6 (* kx (* ky th)))

prune849.0ms

Pruning

14 alts after pruning (14 fresh and 0 done)

Merged error: 8.9b

localize11.0ms

Local error

Found 3 expressions with local error:

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

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 kx) (sin ky))))
7.0ms
(/ (sin ky) (hypot (sin kx) (sin ky)))
0.0ms
(hypot (sin kx) (sin ky))

series643.0ms

Counts
3 → 9
Calls
3 calls:
Slowest
307.0ms
(* (sin th) (/ (sin ky) (hypot (sin kx) (sin ky))))
198.0ms
(/ (sin ky) (hypot (sin kx) (sin ky)))
138.0ms
(hypot (sin kx) (sin ky))

simplify1.6s

Counts
55 → 80
Calls
55 calls:
Slowest
462.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)))))
409.0ms
(- (+ (* 1/12 (* (pow kx 2) ky)) ky) (* 1/6 (pow ky 3)))
160.0ms
(- (+ (* 1/6 (* kx ky)) (* 7/360 (* (pow kx 3) ky))) (* 71/720 (* kx (pow ky 3))))
140.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)))))
100.0ms
(/ (* (* (sin ky) (sin ky)) (sin ky)) (* (* (hypot (sin kx) (sin ky)) (hypot (sin kx) (sin ky))) (hypot (sin kx) (sin ky))))

prune1.1s

Pruning

20 alts after pruning (19 fresh and 1 done)

Merged error: 8.8b

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

rewrite24.0ms

Algorithm
rewrite-expression-head
Rules
72×times-frac
62×add-sqr-sqrt
61×add-cube-cbrt
61×*-un-lft-identity
45×sqrt-prod
22×associate-*l*
22×associate-*r*
20×add-exp-log
20×add-cbrt-cube
12×associate-/r*
associate-/l*
div-exp
cbrt-undiv
pow1
add-log-exp
div-inv
log1p-expm1-u
cbrt-unprod
prod-exp
expm1-log1p-u
frac-2neg
clear-num
*-commutative
associate-*r/
associate-*l/
pow-prod-down
pow1/2
rem-sqrt-square
frac-times
Counts
4 → 162
Calls
4 calls:
Slowest
8.0ms
(* (/ (sin th) (sqrt (hypot (sin kx) (sin ky)))) (/ (sin ky) (sqrt (hypot (sin kx) (sin ky)))))
6.0ms
(/ (sin th) (sqrt (hypot (sin kx) (sin ky))))
4.0ms
(/ (sin ky) (sqrt (hypot (sin kx) (sin ky))))
2.0ms
(sqrt (hypot (sin kx) (sin ky)))

series795.0ms

Counts
4 → 12
Calls
4 calls:
Slowest
237.0ms
(* (/ (sin th) (sqrt (hypot (sin kx) (sin ky)))) (/ (sin ky) (sqrt (hypot (sin kx) (sin ky)))))
212.0ms
(/ (sin th) (sqrt (hypot (sin kx) (sin ky))))
196.0ms
(/ (sin ky) (sqrt (hypot (sin kx) (sin ky))))
150.0ms
(sqrt (hypot (sin kx) (sin ky)))

simplify3.0s

Counts
164 → 174
Calls
164 calls:
Slowest
493.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))))))
419.0ms
(+ (- (log (sin th)) (log (sqrt (hypot (sin kx) (sin ky))))) (- (log (sin ky)) (log (sqrt (hypot (sin kx) (sin ky))))))
262.0ms
(+ (- (log (sin th)) (log (sqrt (hypot (sin kx) (sin ky))))) (log (/ (sin ky) (sqrt (hypot (sin kx) (sin ky))))))
182.0ms
(* (/ (* (* (sin th) (sin th)) (sin th)) (* (* (sqrt (hypot (sin kx) (sin ky))) (sqrt (hypot (sin kx) (sin ky)))) (sqrt (hypot (sin kx) (sin ky))))) (/ (* (* (sin ky) (sin ky)) (sin ky)) (* (* (sqrt (hypot (sin kx) (sin ky))) (sqrt (hypot (sin kx) (sin ky)))) (sqrt (hypot (sin kx) (sin ky))))))
170.0ms
(/ (* (* (sin ky) (sin ky)) (sin ky)) (* (* (sqrt (hypot (sin kx) (sin ky))) (sqrt (hypot (sin kx) (sin ky)))) (sqrt (hypot (sin kx) (sin ky)))))

prune2.4s

Pruning

22 alts after pruning (21 fresh and 1 done)

Merged error: 8.8b

localize31.0ms

Local error

Found 4 expressions with local error:

0.5b
(cbrt (sqrt (hypot (sin kx) (sin ky))))
0.5b
(cbrt (sqrt (hypot (sin kx) (sin ky))))
0.5b
(cbrt (sqrt (hypot (sin kx) (sin ky))))
0.5b
(* (cbrt (sqrt (hypot (sin kx) (sin ky)))) (cbrt (sqrt (hypot (sin kx) (sin ky)))))

rewrite20.0ms

Algorithm
rewrite-expression-head
Rules
30×cbrt-prod
16×add-cube-cbrt
16×*-un-lft-identity
16×add-sqr-sqrt
15×sqrt-prod
associate-*l*
associate-*r*
pow1
pow1/3
add-exp-log
add-log-exp
log1p-expm1-u
add-cbrt-cube
expm1-log1p-u
pow-prod-up
pow-prod-down
cbrt-unprod
*-commutative
prod-exp
pow-plus
pow2
Counts
4 → 84
Calls
4 calls:
Slowest
13.0ms
(* (cbrt (sqrt (hypot (sin kx) (sin ky)))) (cbrt (sqrt (hypot (sin kx) (sin ky)))))
2.0ms
(cbrt (sqrt (hypot (sin kx) (sin ky))))
2.0ms
(cbrt (sqrt (hypot (sin kx) (sin ky))))
2.0ms
(cbrt (sqrt (hypot (sin kx) (sin ky))))

series758.0ms

Counts
4 → 12
Calls
4 calls:
Slowest
202.0ms
(cbrt (sqrt (hypot (sin kx) (sin ky))))
202.0ms
(* (cbrt (sqrt (hypot (sin kx) (sin ky)))) (cbrt (sqrt (hypot (sin kx) (sin ky)))))
183.0ms
(cbrt (sqrt (hypot (sin kx) (sin ky))))
171.0ms
(cbrt (sqrt (hypot (sin kx) (sin ky))))

simplify676.0ms

Counts
56 → 96
Calls
56 calls:
Slowest
157.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)))
131.0ms
(- (+ (* 1/12 (* (pow kx 2) (pow (/ 1 (pow ky 11)) 1/6))) (pow ky 1/6)) (* 1/36 (pow (pow ky 13) 1/6)))
107.0ms
(- (+ (* 1/12 (* (pow kx 2) (pow (/ 1 (pow ky 11)) 1/6))) (pow ky 1/6)) (* 1/36 (pow (pow ky 13) 1/6)))
105.0ms
(- (+ (* 1/12 (* (pow kx 2) (pow (/ 1 (pow ky 11)) 1/6))) (pow ky 1/6)) (* 1/36 (pow (pow ky 13) 1/6)))
13.0ms
(pow (sqrt (+ (pow (sin ky) 2) (pow (sin kx) 2))) 1/3)

prune1.5s

Pruning

23 alts after pruning (22 fresh and 1 done)

Merged error: 8.8b

regimes1.2s

Accuracy

0% (0.1b remaining)

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

bsearch1.0ms

end0.0ms

sample12.1s

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)