Average Error: 12.9 → 9.0
Time: 32.3s
Precision: 64
\[\frac{\sin ky}{\sqrt{{\left(\sin kx\right)}^{2} + {\left(\sin ky\right)}^{2}}} \cdot \sin th\]
\[\sin ky \cdot \frac{\sin th}{\mathsf{hypot}\left(\sin kx, \sin ky\right)}\]
\frac{\sin ky}{\sqrt{{\left(\sin kx\right)}^{2} + {\left(\sin ky\right)}^{2}}} \cdot \sin th
\sin ky \cdot \frac{\sin th}{\mathsf{hypot}\left(\sin kx, \sin ky\right)}
double f(double kx, double ky, double th) {
        double r1143653 = ky;
        double r1143654 = sin(r1143653);
        double r1143655 = kx;
        double r1143656 = sin(r1143655);
        double r1143657 = 2.0;
        double r1143658 = pow(r1143656, r1143657);
        double r1143659 = pow(r1143654, r1143657);
        double r1143660 = r1143658 + r1143659;
        double r1143661 = sqrt(r1143660);
        double r1143662 = r1143654 / r1143661;
        double r1143663 = th;
        double r1143664 = sin(r1143663);
        double r1143665 = r1143662 * r1143664;
        return r1143665;
}

double f(double kx, double ky, double th) {
        double r1143666 = ky;
        double r1143667 = sin(r1143666);
        double r1143668 = th;
        double r1143669 = sin(r1143668);
        double r1143670 = kx;
        double r1143671 = sin(r1143670);
        double r1143672 = hypot(r1143671, r1143667);
        double r1143673 = r1143669 / r1143672;
        double r1143674 = r1143667 * r1143673;
        return r1143674;
}

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

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

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

    \[\leadsto \color{blue}{\frac{\sin ky}{\mathsf{hypot}\left(\sin ky, \sin kx\right)} \cdot \sin th}\]
  5. Using strategy rm
  6. 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\]
  7. 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)}\]
  8. Simplified9.0

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

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

Reproduce

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