Average Error: 12.4 → 9.0
Time: 46.6s
Precision: 64
\[\frac{\sin ky}{\sqrt{{\left(\sin kx\right)}^{2} + {\left(\sin ky\right)}^{2}}} \cdot \sin th\]
\[\sin th \cdot \frac{\frac{\sin ky}{\sqrt{\mathsf{hypot}\left(\sin ky, \sin kx\right)}}}{\sqrt{\mathsf{hypot}\left(\sin ky, \sin kx\right)}}\]
\frac{\sin ky}{\sqrt{{\left(\sin kx\right)}^{2} + {\left(\sin ky\right)}^{2}}} \cdot \sin th
\sin th \cdot \frac{\frac{\sin ky}{\sqrt{\mathsf{hypot}\left(\sin ky, \sin kx\right)}}}{\sqrt{\mathsf{hypot}\left(\sin ky, \sin kx\right)}}
double f(double kx, double ky, double th) {
        double r846687 = ky;
        double r846688 = sin(r846687);
        double r846689 = kx;
        double r846690 = sin(r846689);
        double r846691 = 2.0;
        double r846692 = pow(r846690, r846691);
        double r846693 = pow(r846688, r846691);
        double r846694 = r846692 + r846693;
        double r846695 = sqrt(r846694);
        double r846696 = r846688 / r846695;
        double r846697 = th;
        double r846698 = sin(r846697);
        double r846699 = r846696 * r846698;
        return r846699;
}

double f(double kx, double ky, double th) {
        double r846700 = th;
        double r846701 = sin(r846700);
        double r846702 = ky;
        double r846703 = sin(r846702);
        double r846704 = kx;
        double r846705 = sin(r846704);
        double r846706 = hypot(r846703, r846705);
        double r846707 = sqrt(r846706);
        double r846708 = r846703 / r846707;
        double r846709 = r846708 / r846707;
        double r846710 = r846701 * r846709;
        return r846710;
}

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

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

    \[\leadsto \color{blue}{\sin th \cdot \frac{\sin ky}{\mathsf{hypot}\left(\sin ky, \sin kx\right)}}\]
  3. Using strategy rm
  4. Applied add-sqr-sqrt9.0

    \[\leadsto \sin th \cdot \frac{\sin ky}{\color{blue}{\sqrt{\mathsf{hypot}\left(\sin ky, \sin kx\right)} \cdot \sqrt{\mathsf{hypot}\left(\sin ky, \sin kx\right)}}}\]
  5. Applied *-un-lft-identity9.0

    \[\leadsto \sin th \cdot \frac{\color{blue}{1 \cdot \sin ky}}{\sqrt{\mathsf{hypot}\left(\sin ky, \sin kx\right)} \cdot \sqrt{\mathsf{hypot}\left(\sin ky, \sin kx\right)}}\]
  6. Applied times-frac9.0

    \[\leadsto \sin th \cdot \color{blue}{\left(\frac{1}{\sqrt{\mathsf{hypot}\left(\sin ky, \sin kx\right)}} \cdot \frac{\sin ky}{\sqrt{\mathsf{hypot}\left(\sin ky, \sin kx\right)}}\right)}\]
  7. Applied associate-*r*9.0

    \[\leadsto \color{blue}{\left(\sin th \cdot \frac{1}{\sqrt{\mathsf{hypot}\left(\sin ky, \sin kx\right)}}\right) \cdot \frac{\sin ky}{\sqrt{\mathsf{hypot}\left(\sin ky, \sin kx\right)}}}\]
  8. Using strategy rm
  9. Applied associate-*l*9.0

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

    \[\leadsto \sin th \cdot \color{blue}{\frac{\frac{\sin ky}{\sqrt{\mathsf{hypot}\left(\sin ky, \sin kx\right)}}}{\sqrt{\mathsf{hypot}\left(\sin ky, \sin kx\right)}}}\]
  11. Final simplification9.0

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

Reproduce

herbie shell --seed 2019143 +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)))