Average Error: 1.0 → 0.0
Time: 19.6s
Precision: binary64
\[\sqrt{\frac{1}{2} \cdot \left(1 + \frac{1}{\sqrt{1 + {\left(\frac{2 \cdot \ell}{Om}\right)}^{2} \cdot \left({\sin kx}^{2} + {\sin ky}^{2}\right)}}\right)} \]
\[\sqrt{0.5 + \frac{0.5}{{\left(\left|\sqrt{\mathsf{hypot}\left(1, \frac{2 \cdot \ell}{Om} \cdot \mathsf{hypot}\left(\sin kx, \sin ky\right)\right)}\right|\right)}^{2}}} \]
\sqrt{\frac{1}{2} \cdot \left(1 + \frac{1}{\sqrt{1 + {\left(\frac{2 \cdot \ell}{Om}\right)}^{2} \cdot \left({\sin kx}^{2} + {\sin ky}^{2}\right)}}\right)}
\sqrt{0.5 + \frac{0.5}{{\left(\left|\sqrt{\mathsf{hypot}\left(1, \frac{2 \cdot \ell}{Om} \cdot \mathsf{hypot}\left(\sin kx, \sin ky\right)\right)}\right|\right)}^{2}}}
(FPCore (l Om kx ky)
 :precision binary64
 (sqrt
  (*
   (/ 1.0 2.0)
   (+
    1.0
    (/
     1.0
     (sqrt
      (+
       1.0
       (*
        (pow (/ (* 2.0 l) Om) 2.0)
        (+ (pow (sin kx) 2.0) (pow (sin ky) 2.0))))))))))
(FPCore (l Om kx ky)
 :precision binary64
 (sqrt
  (+
   0.5
   (/
    0.5
    (pow
     (fabs (sqrt (hypot 1.0 (* (/ (* 2.0 l) Om) (hypot (sin kx) (sin ky))))))
     2.0)))))
double code(double l, double Om, double kx, double ky) {
	return sqrt(((1.0 / 2.0) * (1.0 + (1.0 / sqrt((1.0 + (pow(((2.0 * l) / Om), 2.0) * (pow(sin(kx), 2.0) + pow(sin(ky), 2.0)))))))));
}
double code(double l, double Om, double kx, double ky) {
	return sqrt((0.5 + (0.5 / pow(fabs(sqrt(hypot(1.0, (((2.0 * l) / Om) * hypot(sin(kx), sin(ky)))))), 2.0))));
}

Error

Bits error versus l

Bits error versus Om

Bits error versus kx

Bits error versus ky

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 1.0

    \[\sqrt{\frac{1}{2} \cdot \left(1 + \frac{1}{\sqrt{1 + {\left(\frac{2 \cdot \ell}{Om}\right)}^{2} \cdot \left({\sin kx}^{2} + {\sin ky}^{2}\right)}}\right)} \]
  2. Simplified1.0

    \[\leadsto \color{blue}{\sqrt{0.5 + \frac{0.5}{\sqrt{\mathsf{fma}\left({\left(\frac{2 \cdot \ell}{Om}\right)}^{2}, {\sin kx}^{2} + {\sin ky}^{2}, 1\right)}}}} \]
  3. Applied egg-rr1.0

    \[\leadsto \sqrt{0.5 + \frac{0.5}{\color{blue}{{\left({\left(\mathsf{fma}\left({\left(\frac{2 \cdot \ell}{Om}\right)}^{2}, {\left(\mathsf{hypot}\left(\sin kx, \sin ky\right)\right)}^{2}, 1\right)\right)}^{0.25}\right)}^{2}}}} \]
  4. Applied egg-rr0.0

    \[\leadsto \sqrt{0.5 + \frac{0.5}{{\color{blue}{\left(\sqrt{\sqrt{1 + {\left(\frac{2 \cdot \ell}{Om} \cdot \mathsf{hypot}\left(\sin kx, \sin ky\right)\right)}^{2}}}\right)}}^{2}}} \]
  5. Applied egg-rr0.0

    \[\leadsto \sqrt{0.5 + \frac{0.5}{{\color{blue}{\left(\left|\sqrt{\mathsf{hypot}\left(1, \frac{2 \cdot \ell}{Om} \cdot \mathsf{hypot}\left(\sin kx, \sin ky\right)\right)}\right|\right)}}^{2}}} \]
  6. Final simplification0.0

    \[\leadsto \sqrt{0.5 + \frac{0.5}{{\left(\left|\sqrt{\mathsf{hypot}\left(1, \frac{2 \cdot \ell}{Om} \cdot \mathsf{hypot}\left(\sin kx, \sin ky\right)\right)}\right|\right)}^{2}}} \]

Reproduce

herbie shell --seed 2022125 
(FPCore (l Om kx ky)
  :name "Toniolo and Linder, Equation (3a)"
  :precision binary64
  (sqrt (* (/ 1.0 2.0) (+ 1.0 (/ 1.0 (sqrt (+ 1.0 (* (pow (/ (* 2.0 l) Om) 2.0) (+ (pow (sin kx) 2.0) (pow (sin ky) 2.0))))))))))