Average Error: 12.5 → 9.0
Time: 35.1s
Precision: 64
\[\frac{\sin ky}{\sqrt{{\left(\sin kx\right)}^{2} + {\left(\sin ky\right)}^{2}}} \cdot \sin th\]
\[\mathsf{expm1}\left(\left(\mathsf{log1p}\left(\left(\sin th \cdot \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
\mathsf{expm1}\left(\left(\mathsf{log1p}\left(\left(\sin th \cdot \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 r692913 = ky;
        double r692914 = sin(r692913);
        double r692915 = kx;
        double r692916 = sin(r692915);
        double r692917 = 2.0;
        double r692918 = pow(r692916, r692917);
        double r692919 = pow(r692914, r692917);
        double r692920 = r692918 + r692919;
        double r692921 = sqrt(r692920);
        double r692922 = r692914 / r692921;
        double r692923 = th;
        double r692924 = sin(r692923);
        double r692925 = r692922 * r692924;
        return r692925;
}

double f(double kx, double ky, double th) {
        double r692926 = th;
        double r692927 = sin(r692926);
        double r692928 = ky;
        double r692929 = sin(r692928);
        double r692930 = kx;
        double r692931 = sin(r692930);
        double r692932 = hypot(r692931, r692929);
        double r692933 = r692929 / r692932;
        double r692934 = r692927 * r692933;
        double r692935 = log1p(r692934);
        double r692936 = expm1(r692935);
        return r692936;
}

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

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

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

    \[\leadsto \color{blue}{\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)} \cdot \sin th\]
  7. Using strategy rm
  8. Applied expm1-log1p-u9.0

    \[\leadsto \color{blue}{\mathsf{expm1}\left(\left(\mathsf{log1p}\left(\left(\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)\right)\right)\right)\right)} \cdot \sin th\]
  9. Simplified9.0

    \[\leadsto \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) \cdot \sin th\]
  10. Using strategy rm
  11. Applied expm1-log1p-u9.1

    \[\leadsto \color{blue}{\mathsf{expm1}\left(\left(\mathsf{log1p}\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) \cdot \sin th\right)\right)\right)\right)}\]
  12. Simplified9.0

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

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

Reproduce

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