Average Error: 12.4 → 9.3
Time: 37.7s
Precision: 64
\[\frac{\sin ky}{\sqrt{{\left(\sin kx\right)}^{2} + {\left(\sin ky\right)}^{2}}} \cdot \sin th\]
\[\left(\frac{1}{\sqrt{\mathsf{hypot}\left(\sin ky, \sin kx\right)}} \cdot \frac{\sin ky}{\sqrt{\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(\frac{1}{\sqrt{\mathsf{hypot}\left(\sin ky, \sin kx\right)}} \cdot \frac{\sin ky}{\sqrt{\mathsf{hypot}\left(\sin ky, \sin kx\right)}}\right) \cdot \sin th
double f(double kx, double ky, double th) {
        double r604772 = ky;
        double r604773 = sin(r604772);
        double r604774 = kx;
        double r604775 = sin(r604774);
        double r604776 = 2.0;
        double r604777 = pow(r604775, r604776);
        double r604778 = pow(r604773, r604776);
        double r604779 = r604777 + r604778;
        double r604780 = sqrt(r604779);
        double r604781 = r604773 / r604780;
        double r604782 = th;
        double r604783 = sin(r604782);
        double r604784 = r604781 * r604783;
        return r604784;
}

double f(double kx, double ky, double th) {
        double r604785 = 1.0;
        double r604786 = ky;
        double r604787 = sin(r604786);
        double r604788 = kx;
        double r604789 = sin(r604788);
        double r604790 = hypot(r604787, r604789);
        double r604791 = sqrt(r604790);
        double r604792 = r604785 / r604791;
        double r604793 = r604787 / r604791;
        double r604794 = r604792 * r604793;
        double r604795 = th;
        double r604796 = sin(r604795);
        double r604797 = r604794 * r604796;
        return r604797;
}

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

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

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

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

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

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

Reproduce

herbie shell --seed 2019152 +o rules:numerics
(FPCore (kx ky th)
  :name "Toniolo and Linder, Equation (3b), real"
  (* (/ (sin ky) (sqrt (+ (pow (sin kx) 2) (pow (sin ky) 2)))) (sin th)))