Average Error: 12.5 → 8.8
Time: 9.9s
Precision: 64
\[\frac{\sin ky}{\sqrt{{\left(\sin kx\right)}^{2} + {\left(\sin ky\right)}^{2}}} \cdot \sin th\]
\[\left(\sin ky \cdot \frac{1}{\mathsf{hypot}\left(\sin ky, \sin kx\right)}\right) \cdot \sin th\]
\frac{\sin ky}{\sqrt{{\left(\sin kx\right)}^{2} + {\left(\sin ky\right)}^{2}}} \cdot \sin th
\left(\sin ky \cdot \frac{1}{\mathsf{hypot}\left(\sin ky, \sin kx\right)}\right) \cdot \sin th
double f(double kx, double ky, double th) {
        double r33803 = ky;
        double r33804 = sin(r33803);
        double r33805 = kx;
        double r33806 = sin(r33805);
        double r33807 = 2.0;
        double r33808 = pow(r33806, r33807);
        double r33809 = pow(r33804, r33807);
        double r33810 = r33808 + r33809;
        double r33811 = sqrt(r33810);
        double r33812 = r33804 / r33811;
        double r33813 = th;
        double r33814 = sin(r33813);
        double r33815 = r33812 * r33814;
        return r33815;
}

double f(double kx, double ky, double th) {
        double r33816 = ky;
        double r33817 = sin(r33816);
        double r33818 = 1.0;
        double r33819 = kx;
        double r33820 = sin(r33819);
        double r33821 = hypot(r33817, r33820);
        double r33822 = r33818 / r33821;
        double r33823 = r33817 * r33822;
        double r33824 = th;
        double r33825 = sin(r33824);
        double r33826 = r33823 * r33825;
        return r33826;
}

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

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

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

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

    \[\leadsto \frac{\sin ky}{\color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\mathsf{hypot}\left(\sin ky, \sin kx\right)\right)\right)}} \cdot \sin th\]
  6. Using strategy rm
  7. Applied div-inv8.9

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

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

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

Reproduce

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