Average Error: 12.4 → 8.6
Time: 51.4s
Precision: 64
\[\frac{\sin ky}{\sqrt{{\left(\sin kx\right)}^{2} + {\left(\sin ky\right)}^{2}}} \cdot \sin th\]
\[\sin th \cdot \mathsf{log1p}\left(\left(\mathsf{expm1}\left(\left(\frac{\sin ky}{\mathsf{hypot}\left(\left(\sin kx\right), \left(\sin ky\right)\right)}\right)\right)\right)\right)\]
\frac{\sin ky}{\sqrt{{\left(\sin kx\right)}^{2} + {\left(\sin ky\right)}^{2}}} \cdot \sin th
\sin th \cdot \mathsf{log1p}\left(\left(\mathsf{expm1}\left(\left(\frac{\sin ky}{\mathsf{hypot}\left(\left(\sin kx\right), \left(\sin ky\right)\right)}\right)\right)\right)\right)
double f(double kx, double ky, double th) {
        double r1534177 = ky;
        double r1534178 = sin(r1534177);
        double r1534179 = kx;
        double r1534180 = sin(r1534179);
        double r1534181 = 2.0;
        double r1534182 = pow(r1534180, r1534181);
        double r1534183 = pow(r1534178, r1534181);
        double r1534184 = r1534182 + r1534183;
        double r1534185 = sqrt(r1534184);
        double r1534186 = r1534178 / r1534185;
        double r1534187 = th;
        double r1534188 = sin(r1534187);
        double r1534189 = r1534186 * r1534188;
        return r1534189;
}

double f(double kx, double ky, double th) {
        double r1534190 = th;
        double r1534191 = sin(r1534190);
        double r1534192 = ky;
        double r1534193 = sin(r1534192);
        double r1534194 = kx;
        double r1534195 = sin(r1534194);
        double r1534196 = hypot(r1534195, r1534193);
        double r1534197 = r1534193 / r1534196;
        double r1534198 = expm1(r1534197);
        double r1534199 = log1p(r1534198);
        double r1534200 = r1534191 * r1534199;
        return r1534200;
}

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

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

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

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

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

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

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

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

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

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

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

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

Reproduce

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