Average Error: 3.9 → 3.1
Time: 25.2s
Precision: 64
Internal Precision: 576
\[\frac{\sin ky}{\sqrt{{\left(\sin kx\right)}^{2} + {\left(\sin ky\right)}^{2}}} \cdot \sin th\]
\[\begin{array}{l} \mathbf{if}\;\frac{\sin ky}{\sqrt{{\left(\sin kx\right)}^{2} + {\left(\sin ky\right)}^{2}}} \le 1.0:\\ \;\;\;\;\left(\frac{1}{\sqrt{{\left(\sin kx\right)}^{2} + {\left(\sin ky\right)}^{2}}} \cdot \sin th\right) \cdot \sin ky\\ \mathbf{else}:\\ \;\;\;\;\frac{\sin ky}{\left(ky + \left(ky \cdot {kx}^{2}\right) \cdot \frac{1}{12}\right) - {ky}^{3} \cdot \frac{1}{6}} \cdot \sin th\\ \end{array}\]

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. Split input into 2 regimes
  2. if (/ (sin ky) (sqrt (+ (pow (sin kx) 2) (pow (sin ky) 2)))) < 1.0

    1. Initial program 2.1

      \[\frac{\sin ky}{\sqrt{{\left(\sin kx\right)}^{2} + {\left(\sin ky\right)}^{2}}} \cdot \sin th\]
    2. Using strategy rm
    3. Applied div-inv2.2

      \[\leadsto \color{blue}{\left(\sin ky \cdot \frac{1}{\sqrt{{\left(\sin kx\right)}^{2} + {\left(\sin ky\right)}^{2}}}\right)} \cdot \sin th\]
    4. Applied associate-*l*2.2

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

    if 1.0 < (/ (sin ky) (sqrt (+ (pow (sin kx) 2) (pow (sin ky) 2))))

    1. Initial program 61.9

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

      \[\leadsto \frac{\sin ky}{\color{blue}{\left(\frac{1}{12} \cdot \left({kx}^{2} \cdot ky\right) + ky\right) - \frac{1}{6} \cdot {ky}^{3}}} \cdot \sin th\]
  3. Recombined 2 regimes into one program.
  4. Final simplification3.1

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{\sin ky}{\sqrt{{\left(\sin kx\right)}^{2} + {\left(\sin ky\right)}^{2}}} \le 1.0:\\ \;\;\;\;\left(\frac{1}{\sqrt{{\left(\sin kx\right)}^{2} + {\left(\sin ky\right)}^{2}}} \cdot \sin th\right) \cdot \sin ky\\ \mathbf{else}:\\ \;\;\;\;\frac{\sin ky}{\left(ky + \left(ky \cdot {kx}^{2}\right) \cdot \frac{1}{12}\right) - {ky}^{3} \cdot \frac{1}{6}} \cdot \sin th\\ \end{array}\]

Runtime

Time bar (total: 25.2s)Debug logProfile

BaselineHerbieOracleSpan%
Regimes4.13.12.61.566.2%
herbie shell --seed 2018274 
(FPCore (kx ky th)
  :name "Toniolo and Linder, Equation (3b), real"
  (* (/ (sin ky) (sqrt (+ (pow (sin kx) 2) (pow (sin ky) 2)))) (sin th)))