Average Error: 12.5 → 8.9
Time: 10.8s
Precision: 64
\[\frac{\sin ky}{\sqrt{{\left(\sin kx\right)}^{2} + {\left(\sin ky\right)}^{2}}} \cdot \sin th\]
\[\mathsf{log1p}\left(\mathsf{expm1}\left(\frac{\sin ky}{\mathsf{hypot}\left(\sin ky, \sin kx\right)}\right)\right) \cdot \sin th\]
\frac{\sin ky}{\sqrt{{\left(\sin kx\right)}^{2} + {\left(\sin ky\right)}^{2}}} \cdot \sin th
\mathsf{log1p}\left(\mathsf{expm1}\left(\frac{\sin ky}{\mathsf{hypot}\left(\sin ky, \sin kx\right)}\right)\right) \cdot \sin th
double f(double kx, double ky, double th) {
        double r35378 = ky;
        double r35379 = sin(r35378);
        double r35380 = kx;
        double r35381 = sin(r35380);
        double r35382 = 2.0;
        double r35383 = pow(r35381, r35382);
        double r35384 = pow(r35379, r35382);
        double r35385 = r35383 + r35384;
        double r35386 = sqrt(r35385);
        double r35387 = r35379 / r35386;
        double r35388 = th;
        double r35389 = sin(r35388);
        double r35390 = r35387 * r35389;
        return r35390;
}

double f(double kx, double ky, double th) {
        double r35391 = ky;
        double r35392 = sin(r35391);
        double r35393 = kx;
        double r35394 = sin(r35393);
        double r35395 = hypot(r35392, r35394);
        double r35396 = r35392 / r35395;
        double r35397 = expm1(r35396);
        double r35398 = log1p(r35397);
        double r35399 = th;
        double r35400 = sin(r35399);
        double r35401 = r35398 * r35400;
        return r35401;
}

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

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

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

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

Reproduce

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