Average Error: 12.6 → 9.0
Time: 34.6s
Precision: 64
\[\frac{\sin ky}{\sqrt{{\left(\sin kx\right)}^{2} + {\left(\sin ky\right)}^{2}}} \cdot \sin th\]
\[\sin ky \cdot \left(\sin th \cdot \frac{1}{\mathsf{hypot}\left(\sin ky, \sin kx\right)}\right)\]
\frac{\sin ky}{\sqrt{{\left(\sin kx\right)}^{2} + {\left(\sin ky\right)}^{2}}} \cdot \sin th
\sin ky \cdot \left(\sin th \cdot \frac{1}{\mathsf{hypot}\left(\sin ky, \sin kx\right)}\right)
double f(double kx, double ky, double th) {
        double r460168 = ky;
        double r460169 = sin(r460168);
        double r460170 = kx;
        double r460171 = sin(r460170);
        double r460172 = 2.0;
        double r460173 = pow(r460171, r460172);
        double r460174 = pow(r460169, r460172);
        double r460175 = r460173 + r460174;
        double r460176 = sqrt(r460175);
        double r460177 = r460169 / r460176;
        double r460178 = th;
        double r460179 = sin(r460178);
        double r460180 = r460177 * r460179;
        return r460180;
}

double f(double kx, double ky, double th) {
        double r460181 = ky;
        double r460182 = sin(r460181);
        double r460183 = th;
        double r460184 = sin(r460183);
        double r460185 = 1.0;
        double r460186 = kx;
        double r460187 = sin(r460186);
        double r460188 = hypot(r460182, r460187);
        double r460189 = r460185 / r460188;
        double r460190 = r460184 * r460189;
        double r460191 = r460182 * r460190;
        return r460191;
}

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

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

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

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

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

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

    \[\leadsto \color{blue}{\left(1 \cdot \sin th\right)} \cdot \left(\sin ky \cdot \frac{\frac{1}{\sqrt{\mathsf{hypot}\left(\sin ky, \sin kx\right)}}}{\sqrt{\mathsf{hypot}\left(\sin ky, \sin kx\right)}}\right)\]
  10. Applied associate-*l*9.2

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

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

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

Reproduce

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