Average Error: 12.4 → 8.7
Time: 11.7s
Precision: 64
\[\frac{\sin ky}{\sqrt{{\left(\sin kx\right)}^{2} + {\left(\sin ky\right)}^{2}}} \cdot \sin th\]
\[\frac{\sin ky}{\sqrt{1}} \cdot \frac{\sin th}{\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
\frac{\sin ky}{\sqrt{1}} \cdot \frac{\sin th}{\mathsf{hypot}\left(\sin ky, \sin kx\right)}
double f(double kx, double ky, double th) {
        double r38583 = ky;
        double r38584 = sin(r38583);
        double r38585 = kx;
        double r38586 = sin(r38585);
        double r38587 = 2.0;
        double r38588 = pow(r38586, r38587);
        double r38589 = pow(r38584, r38587);
        double r38590 = r38588 + r38589;
        double r38591 = sqrt(r38590);
        double r38592 = r38584 / r38591;
        double r38593 = th;
        double r38594 = sin(r38593);
        double r38595 = r38592 * r38594;
        return r38595;
}

double f(double kx, double ky, double th) {
        double r38596 = ky;
        double r38597 = sin(r38596);
        double r38598 = 1.0;
        double r38599 = sqrt(r38598);
        double r38600 = r38597 / r38599;
        double r38601 = th;
        double r38602 = sin(r38601);
        double r38603 = kx;
        double r38604 = sin(r38603);
        double r38605 = hypot(r38597, r38604);
        double r38606 = r38602 / r38605;
        double r38607 = r38600 * r38606;
        return r38607;
}

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. Taylor expanded around inf 12.4

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

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

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

    \[\leadsto \color{blue}{\frac{\frac{\sin ky}{\sqrt{\mathsf{hypot}\left(\sin ky, \sin kx\right)}}}{\sqrt{\mathsf{hypot}\left(\sin ky, \sin kx\right)}}} \cdot \sin th\]
  7. Using strategy rm
  8. Applied *-un-lft-identity8.9

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

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

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

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

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

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

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

Reproduce

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