Average Error: 12.0 → 8.5
Time: 37.1s
Precision: 64
\[\frac{\sin ky}{\sqrt{{\left(\sin kx\right)}^{2} + {\left(\sin ky\right)}^{2}}} \cdot \sin th\]
\[\frac{\sin th}{\frac{1}{\frac{\sin ky}{\mathsf{hypot}\left(\sin ky, \sin kx\right)}}}\]
\frac{\sin ky}{\sqrt{{\left(\sin kx\right)}^{2} + {\left(\sin ky\right)}^{2}}} \cdot \sin th
\frac{\sin th}{\frac{1}{\frac{\sin ky}{\mathsf{hypot}\left(\sin ky, \sin kx\right)}}}
double f(double kx, double ky, double th) {
        double r542256 = ky;
        double r542257 = sin(r542256);
        double r542258 = kx;
        double r542259 = sin(r542258);
        double r542260 = 2.0;
        double r542261 = pow(r542259, r542260);
        double r542262 = pow(r542257, r542260);
        double r542263 = r542261 + r542262;
        double r542264 = sqrt(r542263);
        double r542265 = r542257 / r542264;
        double r542266 = th;
        double r542267 = sin(r542266);
        double r542268 = r542265 * r542267;
        return r542268;
}

double f(double kx, double ky, double th) {
        double r542269 = th;
        double r542270 = sin(r542269);
        double r542271 = 1.0;
        double r542272 = ky;
        double r542273 = sin(r542272);
        double r542274 = kx;
        double r542275 = sin(r542274);
        double r542276 = hypot(r542273, r542275);
        double r542277 = r542273 / r542276;
        double r542278 = r542271 / r542277;
        double r542279 = r542270 / r542278;
        return r542279;
}

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

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

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

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

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

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

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

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

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

Reproduce

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