Average Error: 12.7 → 9.1
Time: 9.8s
Precision: 64
\[\frac{\sin ky}{\sqrt{{\left(\sin kx\right)}^{2} + {\left(\sin ky\right)}^{2}}} \cdot \sin th\]
\[\frac{\sin ky}{\frac{\mathsf{hypot}\left(\sin ky, \sin kx\right)}{\sin th}}\]
\frac{\sin ky}{\sqrt{{\left(\sin kx\right)}^{2} + {\left(\sin ky\right)}^{2}}} \cdot \sin th
\frac{\sin ky}{\frac{\mathsf{hypot}\left(\sin ky, \sin kx\right)}{\sin th}}
double f(double kx, double ky, double th) {
        double r34430 = ky;
        double r34431 = sin(r34430);
        double r34432 = kx;
        double r34433 = sin(r34432);
        double r34434 = 2.0;
        double r34435 = pow(r34433, r34434);
        double r34436 = pow(r34431, r34434);
        double r34437 = r34435 + r34436;
        double r34438 = sqrt(r34437);
        double r34439 = r34431 / r34438;
        double r34440 = th;
        double r34441 = sin(r34440);
        double r34442 = r34439 * r34441;
        return r34442;
}

double f(double kx, double ky, double th) {
        double r34443 = ky;
        double r34444 = sin(r34443);
        double r34445 = kx;
        double r34446 = sin(r34445);
        double r34447 = hypot(r34444, r34446);
        double r34448 = th;
        double r34449 = sin(r34448);
        double r34450 = r34447 / r34449;
        double r34451 = r34444 / r34450;
        return r34451;
}

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

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

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

    \[\leadsto \frac{\sin ky}{\color{blue}{\mathsf{hypot}\left(\sin ky, \sin kx\right)}} \cdot \sin th\]
  4. Using strategy rm
  5. Applied div-inv9.1

    \[\leadsto \color{blue}{\left(\sin ky \cdot \frac{1}{\mathsf{hypot}\left(\sin ky, \sin kx\right)}\right)} \cdot \sin th\]
  6. Applied associate-*l*9.1

    \[\leadsto \color{blue}{\sin ky \cdot \left(\frac{1}{\mathsf{hypot}\left(\sin ky, \sin kx\right)} \cdot \sin th\right)}\]
  7. Simplified9.1

    \[\leadsto \sin ky \cdot \color{blue}{\frac{\sin th}{\mathsf{hypot}\left(\sin ky, \sin kx\right)}}\]
  8. Using strategy rm
  9. Applied clear-num9.2

    \[\leadsto \sin ky \cdot \color{blue}{\frac{1}{\frac{\mathsf{hypot}\left(\sin ky, \sin kx\right)}{\sin th}}}\]
  10. Using strategy rm
  11. Applied un-div-inv9.1

    \[\leadsto \color{blue}{\frac{\sin ky}{\frac{\mathsf{hypot}\left(\sin ky, \sin kx\right)}{\sin th}}}\]
  12. Final simplification9.1

    \[\leadsto \frac{\sin ky}{\frac{\mathsf{hypot}\left(\sin ky, \sin kx\right)}{\sin th}}\]

Reproduce

herbie shell --seed 2020034 +o rules:numerics
(FPCore (kx ky th)
  :name "Toniolo and Linder, Equation (3b), real"
  :precision binary64
  (* (/ (sin ky) (sqrt (+ (pow (sin kx) 2) (pow (sin ky) 2)))) (sin th)))