Average Error: 1.1 → 0.8
Time: 25.7s
Precision: binary64
Cost: 52672
\[\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 + \log \left(e^{\frac{0.5}{\sqrt{1 + \frac{2 \cdot \ell}{Om} \cdot \left(\frac{2 \cdot \ell}{Om} \cdot \left({\sin kx}^{2} + {\sin ky}^{2}\right)\right)}}}\right)}\]
\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 + \log \left(e^{\frac{0.5}{\sqrt{1 + \frac{2 \cdot \ell}{Om} \cdot \left(\frac{2 \cdot \ell}{Om} \cdot \left({\sin kx}^{2} + {\sin ky}^{2}\right)\right)}}}\right)}
(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
   (log
    (exp
     (/
      0.5
      (sqrt
       (+
        1.0
        (*
         (/ (* 2.0 l) Om)
         (*
          (/ (* 2.0 l) Om)
          (+ (pow (sin kx) 2.0) (pow (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 + log(exp(0.5 / sqrt(1.0 + (((2.0 * l) / Om) * (((2.0 * l) / Om) * (pow(sin(kx), 2.0) + pow(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

Alternatives

Alternative 1
Error0.8
Cost39744
\[\sqrt{0.5 + \frac{0.5}{\sqrt{1 + \frac{\left(\left({\sin kx}^{2} + {\sin ky}^{2}\right) \cdot \frac{\ell}{Om}\right) \cdot \left(\ell \cdot 4\right)}{Om}}}}\]
Alternative 2
Error1.9
Cost40008
\[\begin{array}{l} \mathbf{if}\;\sin kx \leq -2.077595387047645 \cdot 10^{-132} \lor \neg \left(\sin kx \leq 5.571319156255941 \cdot 10^{-123}\right):\\ \;\;\;\;\sqrt{0.5 + \frac{0.5}{\sqrt{1 + \frac{2 \cdot \ell}{Om} \cdot \left(\frac{2 \cdot \ell}{Om} \cdot {\sin kx}^{2}\right)}}}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{0.5 + \frac{0.5}{\sqrt{1 + \frac{2 \cdot \ell}{Om} \cdot \left(\frac{2 \cdot \ell}{Om} \cdot {\sin ky}^{2}\right)}}}\\ \end{array}\]
Alternative 3
Error4.7
Cost40008
\[\begin{array}{l} \mathbf{if}\;\sin kx \leq -7.836070606393636 \cdot 10^{-170} \lor \neg \left(\sin kx \leq 1.7604062973197394 \cdot 10^{-187}\right):\\ \;\;\;\;\sqrt{0.5 + \frac{0.5}{\sqrt{1 + \frac{2 \cdot \ell}{Om} \cdot \left(\frac{2 \cdot \ell}{Om} \cdot {\sin kx}^{2}\right)}}}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{0.5 + \frac{0.5}{\sqrt{1 + 4 \cdot \frac{{\sin ky}^{2} \cdot \left(\ell \cdot \ell\right)}{Om \cdot Om}}}}\\ \end{array}\]
Alternative 4
Error10.6
Cost46915
\[\begin{array}{l} \mathbf{if}\;\sin ky \leq -7.4862524034405 \cdot 10^{-104}:\\ \;\;\;\;\sqrt{0.5 + \frac{0.5}{\sqrt{1 + 4 \cdot \frac{{\sin ky}^{2} \cdot \left(\ell \cdot \ell\right)}{Om \cdot Om}}}}\\ \mathbf{elif}\;\sin ky \leq -3.4194323654837935 \cdot 10^{-186}:\\ \;\;\;\;1\\ \mathbf{elif}\;\sin ky \leq 4.483079975783935 \cdot 10^{-165}:\\ \;\;\;\;\sqrt{0.5 + \frac{0.5}{\sqrt{1 + 4 \cdot \frac{{\sin kx}^{2} \cdot \left(\ell \cdot \ell\right)}{Om \cdot Om}}}}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{0.5 + \frac{0.5}{\sqrt{1 + 4 \cdot \frac{{\sin ky}^{2} \cdot \left(\ell \cdot \ell\right)}{Om \cdot Om}}}}\\ \end{array}\]
Alternative 5
Error12.7
Cost27345
\[\begin{array}{l} \mathbf{if}\;\ell \leq -9.71570446515414 \cdot 10^{+223} \lor \neg \left(\ell \leq -6.077199276602143 \cdot 10^{+194} \lor \neg \left(\ell \leq -9.85489521685411 \cdot 10^{-146}\right) \land \ell \leq 4.89496005856651 \cdot 10^{-136}\right):\\ \;\;\;\;\sqrt{0.5 + \frac{0.5}{\sqrt{1 + 4 \cdot \frac{{\sin ky}^{2} \cdot \left(\ell \cdot \ell\right)}{Om \cdot Om}}}}\\ \mathbf{else}:\\ \;\;\;\;1\\ \end{array}\]
Alternative 6
Error23.7
Cost64
\[1\]

Error

Derivation

  1. Initial program 1.1

    \[\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.1

    \[\leadsto \color{blue}{\sqrt{0.5 + \frac{0.5}{\sqrt{1 + {\left(\frac{2 \cdot \ell}{Om}\right)}^{2} \cdot \left({\sin kx}^{2} + {\sin ky}^{2}\right)}}}}\]
  3. Using strategy rm
  4. Applied add-log-exp_binary64_1171.1

    \[\leadsto \sqrt{0.5 + \color{blue}{\log \left(e^{\frac{0.5}{\sqrt{1 + {\left(\frac{2 \cdot \ell}{Om}\right)}^{2} \cdot \left({\sin kx}^{2} + {\sin ky}^{2}\right)}}}\right)}}\]
  5. Using strategy rm
  6. Applied unpow2_binary64_1431.1

    \[\leadsto \sqrt{0.5 + \log \left(e^{\frac{0.5}{\sqrt{1 + \color{blue}{\left(\frac{2 \cdot \ell}{Om} \cdot \frac{2 \cdot \ell}{Om}\right)} \cdot \left({\sin kx}^{2} + {\sin ky}^{2}\right)}}}\right)}\]
  7. Applied associate-*l*_binary64_190.8

    \[\leadsto \sqrt{0.5 + \log \left(e^{\frac{0.5}{\sqrt{1 + \color{blue}{\frac{2 \cdot \ell}{Om} \cdot \left(\frac{2 \cdot \ell}{Om} \cdot \left({\sin kx}^{2} + {\sin ky}^{2}\right)\right)}}}}\right)}\]
  8. Simplified0.8

    \[\leadsto \color{blue}{\sqrt{0.5 + \log \left(e^{\frac{0.5}{\sqrt{1 + \frac{2 \cdot \ell}{Om} \cdot \left(\frac{2 \cdot \ell}{Om} \cdot \left({\sin kx}^{2} + {\sin ky}^{2}\right)\right)}}}\right)}}\]
  9. Final simplification0.8

    \[\leadsto \sqrt{0.5 + \log \left(e^{\frac{0.5}{\sqrt{1 + \frac{2 \cdot \ell}{Om} \cdot \left(\frac{2 \cdot \ell}{Om} \cdot \left({\sin kx}^{2} + {\sin ky}^{2}\right)\right)}}}\right)}\]

Reproduce

herbie shell --seed 2021044 
(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))))))))))