Average Error: 3.8 → 0.2
Time: 10.1s
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 r34535 = ky;
        double r34536 = sin(r34535);
        double r34537 = kx;
        double r34538 = sin(r34537);
        double r34539 = 2.0;
        double r34540 = pow(r34538, r34539);
        double r34541 = pow(r34536, r34539);
        double r34542 = r34540 + r34541;
        double r34543 = sqrt(r34542);
        double r34544 = r34536 / r34543;
        double r34545 = th;
        double r34546 = sin(r34545);
        double r34547 = r34544 * r34546;
        return r34547;
}

double f(double kx, double ky, double th) {
        double r34548 = ky;
        double r34549 = sin(r34548);
        double r34550 = kx;
        double r34551 = sin(r34550);
        double r34552 = hypot(r34549, r34551);
        double r34553 = r34549 / r34552;
        double r34554 = expm1(r34553);
        double r34555 = log1p(r34554);
        double r34556 = th;
        double r34557 = sin(r34556);
        double r34558 = r34555 * r34557;
        return r34558;
}

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 3.8

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

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

    \[\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-u0.2

    \[\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 simplification0.2

    \[\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 2020060 +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)))