Average Error: 12.3 → 8.7
Time: 27.0s
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 r31620 = ky;
        double r31621 = sin(r31620);
        double r31622 = kx;
        double r31623 = sin(r31622);
        double r31624 = 2.0;
        double r31625 = pow(r31623, r31624);
        double r31626 = pow(r31621, r31624);
        double r31627 = r31625 + r31626;
        double r31628 = sqrt(r31627);
        double r31629 = r31621 / r31628;
        double r31630 = th;
        double r31631 = sin(r31630);
        double r31632 = r31629 * r31631;
        return r31632;
}

double f(double kx, double ky, double th) {
        double r31633 = ky;
        double r31634 = sin(r31633);
        double r31635 = th;
        double r31636 = sin(r31635);
        double r31637 = kx;
        double r31638 = sin(r31637);
        double r31639 = hypot(r31638, r31634);
        double r31640 = r31636 / r31639;
        double r31641 = r31634 * r31640;
        return r31641;
}

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

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

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

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

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

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

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

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

Reproduce

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