Average Error: 12.1 → 8.6
Time: 34.2s
Precision: 64
\[\frac{\sin ky}{\sqrt{{\left(\sin kx\right)}^{2} + {\left(\sin ky\right)}^{2}}} \cdot \sin th\]
\[\frac{\sin ky}{\mathsf{hypot}\left(\sin ky, \sin kx\right)} \cdot \sin th\]
\frac{\sin ky}{\sqrt{{\left(\sin kx\right)}^{2} + {\left(\sin ky\right)}^{2}}} \cdot \sin th
\frac{\sin ky}{\mathsf{hypot}\left(\sin ky, \sin kx\right)} \cdot \sin th
double f(double kx, double ky, double th) {
        double r34587 = ky;
        double r34588 = sin(r34587);
        double r34589 = kx;
        double r34590 = sin(r34589);
        double r34591 = 2.0;
        double r34592 = pow(r34590, r34591);
        double r34593 = pow(r34588, r34591);
        double r34594 = r34592 + r34593;
        double r34595 = sqrt(r34594);
        double r34596 = r34588 / r34595;
        double r34597 = th;
        double r34598 = sin(r34597);
        double r34599 = r34596 * r34598;
        return r34599;
}

double f(double kx, double ky, double th) {
        double r34600 = ky;
        double r34601 = sin(r34600);
        double r34602 = kx;
        double r34603 = sin(r34602);
        double r34604 = hypot(r34601, r34603);
        double r34605 = r34601 / r34604;
        double r34606 = th;
        double r34607 = sin(r34606);
        double r34608 = r34605 * r34607;
        return r34608;
}

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

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

    \[\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 div-inv8.7

    \[\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*8.8

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

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

    \[\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 associate-/r/8.8

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

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

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

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

Reproduce

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