Average Error: 12.2 → 8.5
Time: 28.9s
Precision: 64
\[\frac{\sin ky}{\sqrt{{\left(\sin kx\right)}^{2} + {\left(\sin ky\right)}^{2}}} \cdot \sin th\]
\[\frac{\sin th}{\mathsf{hypot}\left(\sin ky, \sin kx\right)} \cdot \sin ky\]
\frac{\sin ky}{\sqrt{{\left(\sin kx\right)}^{2} + {\left(\sin ky\right)}^{2}}} \cdot \sin th
\frac{\sin th}{\mathsf{hypot}\left(\sin ky, \sin kx\right)} \cdot \sin ky
double f(double kx, double ky, double th) {
        double r31562 = ky;
        double r31563 = sin(r31562);
        double r31564 = kx;
        double r31565 = sin(r31564);
        double r31566 = 2.0;
        double r31567 = pow(r31565, r31566);
        double r31568 = pow(r31563, r31566);
        double r31569 = r31567 + r31568;
        double r31570 = sqrt(r31569);
        double r31571 = r31563 / r31570;
        double r31572 = th;
        double r31573 = sin(r31572);
        double r31574 = r31571 * r31573;
        return r31574;
}

double f(double kx, double ky, double th) {
        double r31575 = th;
        double r31576 = sin(r31575);
        double r31577 = ky;
        double r31578 = sin(r31577);
        double r31579 = kx;
        double r31580 = sin(r31579);
        double r31581 = hypot(r31578, r31580);
        double r31582 = r31576 / r31581;
        double r31583 = r31582 * r31578;
        return r31583;
}

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

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

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

    \[\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.6

    \[\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.6

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

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

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

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

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

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

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

Reproduce

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