Average Error: 27.0 → 14.4
Time: 16.9s
Precision: binary64
\[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\]
\[\begin{array}{l} \mathbf{if}\;\ell \leq 3.160788038203812 \cdot 10^{+93}:\\ \;\;\;\;\left(\left(\left|\frac{\sqrt[3]{d}}{\sqrt[3]{h}}\right| \cdot \sqrt{\frac{\sqrt[3]{d}}{\sqrt[3]{h}}}\right) \cdot \left(\sqrt{\sqrt[3]{d} \cdot \sqrt[3]{d}} \cdot \sqrt{\frac{\sqrt[3]{d}}{\ell}}\right)\right) \cdot \left(1 - \left(\left(0.5 \cdot {\left(\frac{M \cdot D}{d \cdot 2}\right)}^{2}\right) \cdot \left(\sqrt[3]{h} \cdot \sqrt[3]{h}\right)\right) \cdot \frac{\sqrt[3]{h}}{\ell}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{d \cdot \left(1 - \left(0.5 \cdot {\left(\frac{M \cdot D}{d \cdot 2}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)}{\sqrt{h} \cdot \sqrt{\ell}}\\ \end{array}\]
\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)
\begin{array}{l}
\mathbf{if}\;\ell \leq 3.160788038203812 \cdot 10^{+93}:\\
\;\;\;\;\left(\left(\left|\frac{\sqrt[3]{d}}{\sqrt[3]{h}}\right| \cdot \sqrt{\frac{\sqrt[3]{d}}{\sqrt[3]{h}}}\right) \cdot \left(\sqrt{\sqrt[3]{d} \cdot \sqrt[3]{d}} \cdot \sqrt{\frac{\sqrt[3]{d}}{\ell}}\right)\right) \cdot \left(1 - \left(\left(0.5 \cdot {\left(\frac{M \cdot D}{d \cdot 2}\right)}^{2}\right) \cdot \left(\sqrt[3]{h} \cdot \sqrt[3]{h}\right)\right) \cdot \frac{\sqrt[3]{h}}{\ell}\right)\\

\mathbf{else}:\\
\;\;\;\;\frac{d \cdot \left(1 - \left(0.5 \cdot {\left(\frac{M \cdot D}{d \cdot 2}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)}{\sqrt{h} \cdot \sqrt{\ell}}\\

\end{array}
(FPCore (d h l M D)
 :precision binary64
 (*
  (* (pow (/ d h) (/ 1.0 2.0)) (pow (/ d l) (/ 1.0 2.0)))
  (- 1.0 (* (* (/ 1.0 2.0) (pow (/ (* M D) (* 2.0 d)) 2.0)) (/ h l)))))
(FPCore (d h l M D)
 :precision binary64
 (if (<= l 3.160788038203812e+93)
   (*
    (*
     (* (fabs (/ (cbrt d) (cbrt h))) (sqrt (/ (cbrt d) (cbrt h))))
     (* (sqrt (* (cbrt d) (cbrt d))) (sqrt (/ (cbrt d) l))))
    (-
     1.0
     (*
      (* (* 0.5 (pow (/ (* M D) (* d 2.0)) 2.0)) (* (cbrt h) (cbrt h)))
      (/ (cbrt h) l))))
   (/
    (* d (- 1.0 (* (* 0.5 (pow (/ (* M D) (* d 2.0)) 2.0)) (/ h l))))
    (* (sqrt h) (sqrt l)))))
double code(double d, double h, double l, double M, double D) {
	return (pow((d / h), (1.0 / 2.0)) * pow((d / l), (1.0 / 2.0))) * (1.0 - (((1.0 / 2.0) * pow(((M * D) / (2.0 * d)), 2.0)) * (h / l)));
}
double code(double d, double h, double l, double M, double D) {
	double tmp;
	if (l <= 3.160788038203812e+93) {
		tmp = ((fabs(cbrt(d) / cbrt(h)) * sqrt(cbrt(d) / cbrt(h))) * (sqrt(cbrt(d) * cbrt(d)) * sqrt(cbrt(d) / l))) * (1.0 - (((0.5 * pow(((M * D) / (d * 2.0)), 2.0)) * (cbrt(h) * cbrt(h))) * (cbrt(h) / l)));
	} else {
		tmp = (d * (1.0 - ((0.5 * pow(((M * D) / (d * 2.0)), 2.0)) * (h / l)))) / (sqrt(h) * sqrt(l));
	}
	return tmp;
}

Error

Bits error versus d

Bits error versus h

Bits error versus l

Bits error versus M

Bits error versus D

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Split input into 2 regimes
  2. if l < 3.16078803820381208e93

    1. Initial program 26.6

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\]
    2. Simplified26.6

      \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - \left(0.5 \cdot {\left(\frac{M \cdot D}{d \cdot 2}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)}\]
    3. Using strategy rm
    4. Applied add-cube-cbrt_binary6426.8

      \[\leadsto \left(\sqrt{\frac{d}{\color{blue}{\left(\sqrt[3]{h} \cdot \sqrt[3]{h}\right) \cdot \sqrt[3]{h}}}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - \left(0.5 \cdot {\left(\frac{M \cdot D}{d \cdot 2}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\]
    5. Applied add-cube-cbrt_binary6426.9

      \[\leadsto \left(\sqrt{\frac{\color{blue}{\left(\sqrt[3]{d} \cdot \sqrt[3]{d}\right) \cdot \sqrt[3]{d}}}{\left(\sqrt[3]{h} \cdot \sqrt[3]{h}\right) \cdot \sqrt[3]{h}}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - \left(0.5 \cdot {\left(\frac{M \cdot D}{d \cdot 2}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\]
    6. Applied times-frac_binary6426.9

      \[\leadsto \left(\sqrt{\color{blue}{\frac{\sqrt[3]{d} \cdot \sqrt[3]{d}}{\sqrt[3]{h} \cdot \sqrt[3]{h}} \cdot \frac{\sqrt[3]{d}}{\sqrt[3]{h}}}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - \left(0.5 \cdot {\left(\frac{M \cdot D}{d \cdot 2}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\]
    7. Applied sqrt-prod_binary6421.3

      \[\leadsto \left(\color{blue}{\left(\sqrt{\frac{\sqrt[3]{d} \cdot \sqrt[3]{d}}{\sqrt[3]{h} \cdot \sqrt[3]{h}}} \cdot \sqrt{\frac{\sqrt[3]{d}}{\sqrt[3]{h}}}\right)} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - \left(0.5 \cdot {\left(\frac{M \cdot D}{d \cdot 2}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\]
    8. Simplified20.7

      \[\leadsto \left(\left(\color{blue}{\left|\frac{\sqrt[3]{d}}{\sqrt[3]{h}}\right|} \cdot \sqrt{\frac{\sqrt[3]{d}}{\sqrt[3]{h}}}\right) \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - \left(0.5 \cdot {\left(\frac{M \cdot D}{d \cdot 2}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\]
    9. Using strategy rm
    10. Applied *-un-lft-identity_binary6420.7

      \[\leadsto \left(\left(\left|\frac{\sqrt[3]{d}}{\sqrt[3]{h}}\right| \cdot \sqrt{\frac{\sqrt[3]{d}}{\sqrt[3]{h}}}\right) \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - \left(0.5 \cdot {\left(\frac{M \cdot D}{d \cdot 2}\right)}^{2}\right) \cdot \frac{h}{\color{blue}{1 \cdot \ell}}\right)\]
    11. Applied add-cube-cbrt_binary6420.7

      \[\leadsto \left(\left(\left|\frac{\sqrt[3]{d}}{\sqrt[3]{h}}\right| \cdot \sqrt{\frac{\sqrt[3]{d}}{\sqrt[3]{h}}}\right) \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - \left(0.5 \cdot {\left(\frac{M \cdot D}{d \cdot 2}\right)}^{2}\right) \cdot \frac{\color{blue}{\left(\sqrt[3]{h} \cdot \sqrt[3]{h}\right) \cdot \sqrt[3]{h}}}{1 \cdot \ell}\right)\]
    12. Applied times-frac_binary6420.7

      \[\leadsto \left(\left(\left|\frac{\sqrt[3]{d}}{\sqrt[3]{h}}\right| \cdot \sqrt{\frac{\sqrt[3]{d}}{\sqrt[3]{h}}}\right) \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - \left(0.5 \cdot {\left(\frac{M \cdot D}{d \cdot 2}\right)}^{2}\right) \cdot \color{blue}{\left(\frac{\sqrt[3]{h} \cdot \sqrt[3]{h}}{1} \cdot \frac{\sqrt[3]{h}}{\ell}\right)}\right)\]
    13. Applied associate-*r*_binary6418.6

      \[\leadsto \left(\left(\left|\frac{\sqrt[3]{d}}{\sqrt[3]{h}}\right| \cdot \sqrt{\frac{\sqrt[3]{d}}{\sqrt[3]{h}}}\right) \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - \color{blue}{\left(\left(0.5 \cdot {\left(\frac{M \cdot D}{d \cdot 2}\right)}^{2}\right) \cdot \frac{\sqrt[3]{h} \cdot \sqrt[3]{h}}{1}\right) \cdot \frac{\sqrt[3]{h}}{\ell}}\right)\]
    14. Simplified18.6

      \[\leadsto \left(\left(\left|\frac{\sqrt[3]{d}}{\sqrt[3]{h}}\right| \cdot \sqrt{\frac{\sqrt[3]{d}}{\sqrt[3]{h}}}\right) \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - \color{blue}{\left(\left(0.5 \cdot {\left(\frac{M \cdot D}{d \cdot 2}\right)}^{2}\right) \cdot \left(\sqrt[3]{h} \cdot \sqrt[3]{h}\right)\right)} \cdot \frac{\sqrt[3]{h}}{\ell}\right)\]
    15. Using strategy rm
    16. Applied *-un-lft-identity_binary6418.6

      \[\leadsto \left(\left(\left|\frac{\sqrt[3]{d}}{\sqrt[3]{h}}\right| \cdot \sqrt{\frac{\sqrt[3]{d}}{\sqrt[3]{h}}}\right) \cdot \sqrt{\frac{d}{\color{blue}{1 \cdot \ell}}}\right) \cdot \left(1 - \left(\left(0.5 \cdot {\left(\frac{M \cdot D}{d \cdot 2}\right)}^{2}\right) \cdot \left(\sqrt[3]{h} \cdot \sqrt[3]{h}\right)\right) \cdot \frac{\sqrt[3]{h}}{\ell}\right)\]
    17. Applied add-cube-cbrt_binary6418.8

      \[\leadsto \left(\left(\left|\frac{\sqrt[3]{d}}{\sqrt[3]{h}}\right| \cdot \sqrt{\frac{\sqrt[3]{d}}{\sqrt[3]{h}}}\right) \cdot \sqrt{\frac{\color{blue}{\left(\sqrt[3]{d} \cdot \sqrt[3]{d}\right) \cdot \sqrt[3]{d}}}{1 \cdot \ell}}\right) \cdot \left(1 - \left(\left(0.5 \cdot {\left(\frac{M \cdot D}{d \cdot 2}\right)}^{2}\right) \cdot \left(\sqrt[3]{h} \cdot \sqrt[3]{h}\right)\right) \cdot \frac{\sqrt[3]{h}}{\ell}\right)\]
    18. Applied times-frac_binary6418.8

      \[\leadsto \left(\left(\left|\frac{\sqrt[3]{d}}{\sqrt[3]{h}}\right| \cdot \sqrt{\frac{\sqrt[3]{d}}{\sqrt[3]{h}}}\right) \cdot \sqrt{\color{blue}{\frac{\sqrt[3]{d} \cdot \sqrt[3]{d}}{1} \cdot \frac{\sqrt[3]{d}}{\ell}}}\right) \cdot \left(1 - \left(\left(0.5 \cdot {\left(\frac{M \cdot D}{d \cdot 2}\right)}^{2}\right) \cdot \left(\sqrt[3]{h} \cdot \sqrt[3]{h}\right)\right) \cdot \frac{\sqrt[3]{h}}{\ell}\right)\]
    19. Applied sqrt-prod_binary6414.3

      \[\leadsto \left(\left(\left|\frac{\sqrt[3]{d}}{\sqrt[3]{h}}\right| \cdot \sqrt{\frac{\sqrt[3]{d}}{\sqrt[3]{h}}}\right) \cdot \color{blue}{\left(\sqrt{\frac{\sqrt[3]{d} \cdot \sqrt[3]{d}}{1}} \cdot \sqrt{\frac{\sqrt[3]{d}}{\ell}}\right)}\right) \cdot \left(1 - \left(\left(0.5 \cdot {\left(\frac{M \cdot D}{d \cdot 2}\right)}^{2}\right) \cdot \left(\sqrt[3]{h} \cdot \sqrt[3]{h}\right)\right) \cdot \frac{\sqrt[3]{h}}{\ell}\right)\]
    20. Simplified14.3

      \[\leadsto \left(\left(\left|\frac{\sqrt[3]{d}}{\sqrt[3]{h}}\right| \cdot \sqrt{\frac{\sqrt[3]{d}}{\sqrt[3]{h}}}\right) \cdot \left(\color{blue}{\sqrt{\sqrt[3]{d} \cdot \sqrt[3]{d}}} \cdot \sqrt{\frac{\sqrt[3]{d}}{\ell}}\right)\right) \cdot \left(1 - \left(\left(0.5 \cdot {\left(\frac{M \cdot D}{d \cdot 2}\right)}^{2}\right) \cdot \left(\sqrt[3]{h} \cdot \sqrt[3]{h}\right)\right) \cdot \frac{\sqrt[3]{h}}{\ell}\right)\]

    if 3.16078803820381208e93 < l

    1. Initial program 28.5

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\]
    2. Simplified28.5

      \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - \left(0.5 \cdot {\left(\frac{M \cdot D}{d \cdot 2}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)}\]
    3. Using strategy rm
    4. Applied sqrt-div_binary6423.3

      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \color{blue}{\frac{\sqrt{d}}{\sqrt{\ell}}}\right) \cdot \left(1 - \left(0.5 \cdot {\left(\frac{M \cdot D}{d \cdot 2}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\]
    5. Applied sqrt-div_binary6415.8

      \[\leadsto \left(\color{blue}{\frac{\sqrt{d}}{\sqrt{h}}} \cdot \frac{\sqrt{d}}{\sqrt{\ell}}\right) \cdot \left(1 - \left(0.5 \cdot {\left(\frac{M \cdot D}{d \cdot 2}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\]
    6. Applied frac-times_binary6415.8

      \[\leadsto \color{blue}{\frac{\sqrt{d} \cdot \sqrt{d}}{\sqrt{h} \cdot \sqrt{\ell}}} \cdot \left(1 - \left(0.5 \cdot {\left(\frac{M \cdot D}{d \cdot 2}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\]
    7. Applied associate-*l/_binary6415.1

      \[\leadsto \color{blue}{\frac{\left(\sqrt{d} \cdot \sqrt{d}\right) \cdot \left(1 - \left(0.5 \cdot {\left(\frac{M \cdot D}{d \cdot 2}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)}{\sqrt{h} \cdot \sqrt{\ell}}}\]
    8. Simplified15.0

      \[\leadsto \frac{\color{blue}{d \cdot \left(1 - \left(0.5 \cdot {\left(\frac{M \cdot D}{d \cdot 2}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)}}{\sqrt{h} \cdot \sqrt{\ell}}\]
  3. Recombined 2 regimes into one program.
  4. Final simplification14.4

    \[\leadsto \begin{array}{l} \mathbf{if}\;\ell \leq 3.160788038203812 \cdot 10^{+93}:\\ \;\;\;\;\left(\left(\left|\frac{\sqrt[3]{d}}{\sqrt[3]{h}}\right| \cdot \sqrt{\frac{\sqrt[3]{d}}{\sqrt[3]{h}}}\right) \cdot \left(\sqrt{\sqrt[3]{d} \cdot \sqrt[3]{d}} \cdot \sqrt{\frac{\sqrt[3]{d}}{\ell}}\right)\right) \cdot \left(1 - \left(\left(0.5 \cdot {\left(\frac{M \cdot D}{d \cdot 2}\right)}^{2}\right) \cdot \left(\sqrt[3]{h} \cdot \sqrt[3]{h}\right)\right) \cdot \frac{\sqrt[3]{h}}{\ell}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{d \cdot \left(1 - \left(0.5 \cdot {\left(\frac{M \cdot D}{d \cdot 2}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)}{\sqrt{h} \cdot \sqrt{\ell}}\\ \end{array}\]

Reproduce

herbie shell --seed 2020268 
(FPCore (d h l M D)
  :name "Henrywood and Agarwal, Equation (12)"
  :precision binary64
  (* (* (pow (/ d h) (/ 1.0 2.0)) (pow (/ d l) (/ 1.0 2.0))) (- 1.0 (* (* (/ 1.0 2.0) (pow (/ (* M D) (* 2.0 d)) 2.0)) (/ h l)))))