Average Error: 12.7 → 9.0
Time: 10.1s
Precision: 64
\[\frac{\sin ky}{\sqrt{{\left(\sin kx\right)}^{2} + {\left(\sin ky\right)}^{2}}} \cdot \sin th\]
\[\frac{1}{\frac{1 \cdot \mathsf{hypot}\left(\sin ky, \sin kx\right)}{\sin ky}} \cdot \sin th\]
\frac{\sin ky}{\sqrt{{\left(\sin kx\right)}^{2} + {\left(\sin ky\right)}^{2}}} \cdot \sin th
\frac{1}{\frac{1 \cdot \mathsf{hypot}\left(\sin ky, \sin kx\right)}{\sin ky}} \cdot \sin th
double f(double kx, double ky, double th) {
        double r37604 = ky;
        double r37605 = sin(r37604);
        double r37606 = kx;
        double r37607 = sin(r37606);
        double r37608 = 2.0;
        double r37609 = pow(r37607, r37608);
        double r37610 = pow(r37605, r37608);
        double r37611 = r37609 + r37610;
        double r37612 = sqrt(r37611);
        double r37613 = r37605 / r37612;
        double r37614 = th;
        double r37615 = sin(r37614);
        double r37616 = r37613 * r37615;
        return r37616;
}

double f(double kx, double ky, double th) {
        double r37617 = 1.0;
        double r37618 = ky;
        double r37619 = sin(r37618);
        double r37620 = kx;
        double r37621 = sin(r37620);
        double r37622 = hypot(r37619, r37621);
        double r37623 = r37617 * r37622;
        double r37624 = r37623 / r37619;
        double r37625 = r37617 / r37624;
        double r37626 = th;
        double r37627 = sin(r37626);
        double r37628 = r37625 * r37627;
        return r37628;
}

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

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

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

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

    \[\leadsto \color{blue}{\frac{1}{\frac{\mathsf{hypot}\left(\sin ky, \sin kx\right)}{\sin ky}}} \cdot \sin th\]
  6. Using strategy rm
  7. Applied *-un-lft-identity9.0

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

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

Reproduce

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