Average Error: 12.8 → 8.8
Time: 11.1s
Precision: 64
\[\frac{\sin ky}{\sqrt{{\left(\sin kx\right)}^{2} + {\left(\sin ky\right)}^{2}}} \cdot \sin th\]
\[\sin ky \cdot \frac{\sin th}{\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
\sin ky \cdot \frac{\sin th}{\mathsf{hypot}\left(\sin ky, \sin kx\right)}
double f(double kx, double ky, double th) {
        double r41465 = ky;
        double r41466 = sin(r41465);
        double r41467 = kx;
        double r41468 = sin(r41467);
        double r41469 = 2.0;
        double r41470 = pow(r41468, r41469);
        double r41471 = pow(r41466, r41469);
        double r41472 = r41470 + r41471;
        double r41473 = sqrt(r41472);
        double r41474 = r41466 / r41473;
        double r41475 = th;
        double r41476 = sin(r41475);
        double r41477 = r41474 * r41476;
        return r41477;
}

double f(double kx, double ky, double th) {
        double r41478 = ky;
        double r41479 = sin(r41478);
        double r41480 = th;
        double r41481 = sin(r41480);
        double r41482 = kx;
        double r41483 = sin(r41482);
        double r41484 = hypot(r41479, r41483);
        double r41485 = r41481 / r41484;
        double r41486 = r41479 * r41485;
        return r41486;
}

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

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

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

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

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

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

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

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

Reproduce

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