Average Error: 40.2 → 25.9
Time: 16.2s
Precision: 64
\[\sqrt{\frac{w \cdot \left(\left(v - m\right) \cdot \left(v - m\right)\right)}{t}}\]
\[\begin{array}{l} \mathbf{if}\;w \le -2.143944468090101249010401365732409537263 \cdot 10^{-310}:\\ \;\;\;\;\sqrt{\frac{w \cdot \left(v - m\right)}{\sqrt[3]{t} \cdot \sqrt[3]{t}} \cdot \frac{v - m}{\sqrt[3]{t}}}\\ \mathbf{elif}\;w \le 4.484078778607641341976518811226128687364 \cdot 10^{-144}:\\ \;\;\;\;\frac{\sqrt{\left(w \cdot \left(v - m\right)\right) \cdot \left(v - m\right)}}{\sqrt{t}}\\ \mathbf{elif}\;w \le 5.564182326867624870557797113265992236836 \cdot 10^{-33}:\\ \;\;\;\;\sqrt{\frac{w \cdot \left(v - m\right)}{\frac{t}{v - m}}}\\ \mathbf{elif}\;w \le 2.753529905199559784711065200240629840758 \cdot 10^{125}:\\ \;\;\;\;\sqrt{\left(w \cdot \left(v - m\right)\right) \cdot \left(v - m\right)} \cdot \sqrt{\frac{1}{t}}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\frac{w}{\sqrt[3]{t} \cdot \sqrt[3]{t}}} \cdot \sqrt{\frac{\left(v - m\right) \cdot \left(v - m\right)}{\sqrt[3]{t}}}\\ \end{array}\]
\sqrt{\frac{w \cdot \left(\left(v - m\right) \cdot \left(v - m\right)\right)}{t}}
\begin{array}{l}
\mathbf{if}\;w \le -2.143944468090101249010401365732409537263 \cdot 10^{-310}:\\
\;\;\;\;\sqrt{\frac{w \cdot \left(v - m\right)}{\sqrt[3]{t} \cdot \sqrt[3]{t}} \cdot \frac{v - m}{\sqrt[3]{t}}}\\

\mathbf{elif}\;w \le 4.484078778607641341976518811226128687364 \cdot 10^{-144}:\\
\;\;\;\;\frac{\sqrt{\left(w \cdot \left(v - m\right)\right) \cdot \left(v - m\right)}}{\sqrt{t}}\\

\mathbf{elif}\;w \le 5.564182326867624870557797113265992236836 \cdot 10^{-33}:\\
\;\;\;\;\sqrt{\frac{w \cdot \left(v - m\right)}{\frac{t}{v - m}}}\\

\mathbf{elif}\;w \le 2.753529905199559784711065200240629840758 \cdot 10^{125}:\\
\;\;\;\;\sqrt{\left(w \cdot \left(v - m\right)\right) \cdot \left(v - m\right)} \cdot \sqrt{\frac{1}{t}}\\

\mathbf{else}:\\
\;\;\;\;\sqrt{\frac{w}{\sqrt[3]{t} \cdot \sqrt[3]{t}}} \cdot \sqrt{\frac{\left(v - m\right) \cdot \left(v - m\right)}{\sqrt[3]{t}}}\\

\end{array}
double f(double w, double v, double m, double t) {
        double r2647735 = w;
        double r2647736 = v;
        double r2647737 = m;
        double r2647738 = r2647736 - r2647737;
        double r2647739 = r2647738 * r2647738;
        double r2647740 = r2647735 * r2647739;
        double r2647741 = t;
        double r2647742 = r2647740 / r2647741;
        double r2647743 = sqrt(r2647742);
        return r2647743;
}

double f(double w, double v, double m, double t) {
        double r2647744 = w;
        double r2647745 = -2.1439444680901e-310;
        bool r2647746 = r2647744 <= r2647745;
        double r2647747 = v;
        double r2647748 = m;
        double r2647749 = r2647747 - r2647748;
        double r2647750 = r2647744 * r2647749;
        double r2647751 = t;
        double r2647752 = cbrt(r2647751);
        double r2647753 = r2647752 * r2647752;
        double r2647754 = r2647750 / r2647753;
        double r2647755 = r2647749 / r2647752;
        double r2647756 = r2647754 * r2647755;
        double r2647757 = sqrt(r2647756);
        double r2647758 = 4.4840787786076413e-144;
        bool r2647759 = r2647744 <= r2647758;
        double r2647760 = r2647750 * r2647749;
        double r2647761 = sqrt(r2647760);
        double r2647762 = sqrt(r2647751);
        double r2647763 = r2647761 / r2647762;
        double r2647764 = 5.564182326867625e-33;
        bool r2647765 = r2647744 <= r2647764;
        double r2647766 = r2647751 / r2647749;
        double r2647767 = r2647750 / r2647766;
        double r2647768 = sqrt(r2647767);
        double r2647769 = 2.7535299051995598e+125;
        bool r2647770 = r2647744 <= r2647769;
        double r2647771 = 1.0;
        double r2647772 = r2647771 / r2647751;
        double r2647773 = sqrt(r2647772);
        double r2647774 = r2647761 * r2647773;
        double r2647775 = r2647744 / r2647753;
        double r2647776 = sqrt(r2647775);
        double r2647777 = r2647749 * r2647749;
        double r2647778 = r2647777 / r2647752;
        double r2647779 = sqrt(r2647778);
        double r2647780 = r2647776 * r2647779;
        double r2647781 = r2647770 ? r2647774 : r2647780;
        double r2647782 = r2647765 ? r2647768 : r2647781;
        double r2647783 = r2647759 ? r2647763 : r2647782;
        double r2647784 = r2647746 ? r2647757 : r2647783;
        return r2647784;
}

Error

Bits error versus w

Bits error versus v

Bits error versus m

Bits error versus t

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Split input into 5 regimes
  2. if w < -2.1439444680901e-310

    1. Initial program 39.9

      \[\sqrt{\frac{w \cdot \left(\left(v - m\right) \cdot \left(v - m\right)\right)}{t}}\]
    2. Using strategy rm
    3. Applied associate-*r*33.6

      \[\leadsto \sqrt{\frac{\color{blue}{\left(w \cdot \left(v - m\right)\right) \cdot \left(v - m\right)}}{t}}\]
    4. Using strategy rm
    5. Applied add-cube-cbrt33.9

      \[\leadsto \sqrt{\frac{\left(w \cdot \left(v - m\right)\right) \cdot \left(v - m\right)}{\color{blue}{\left(\sqrt[3]{t} \cdot \sqrt[3]{t}\right) \cdot \sqrt[3]{t}}}}\]
    6. Applied times-frac27.6

      \[\leadsto \sqrt{\color{blue}{\frac{w \cdot \left(v - m\right)}{\sqrt[3]{t} \cdot \sqrt[3]{t}} \cdot \frac{v - m}{\sqrt[3]{t}}}}\]

    if -2.1439444680901e-310 < w < 4.4840787786076413e-144

    1. Initial program 41.9

      \[\sqrt{\frac{w \cdot \left(\left(v - m\right) \cdot \left(v - m\right)\right)}{t}}\]
    2. Using strategy rm
    3. Applied associate-*r*26.1

      \[\leadsto \sqrt{\frac{\color{blue}{\left(w \cdot \left(v - m\right)\right) \cdot \left(v - m\right)}}{t}}\]
    4. Using strategy rm
    5. Applied sqrt-div15.1

      \[\leadsto \color{blue}{\frac{\sqrt{\left(w \cdot \left(v - m\right)\right) \cdot \left(v - m\right)}}{\sqrt{t}}}\]

    if 4.4840787786076413e-144 < w < 5.564182326867625e-33

    1. Initial program 35.1

      \[\sqrt{\frac{w \cdot \left(\left(v - m\right) \cdot \left(v - m\right)\right)}{t}}\]
    2. Using strategy rm
    3. Applied associate-*r*30.5

      \[\leadsto \sqrt{\frac{\color{blue}{\left(w \cdot \left(v - m\right)\right) \cdot \left(v - m\right)}}{t}}\]
    4. Using strategy rm
    5. Applied associate-/l*22.5

      \[\leadsto \sqrt{\color{blue}{\frac{w \cdot \left(v - m\right)}{\frac{t}{v - m}}}}\]

    if 5.564182326867625e-33 < w < 2.7535299051995598e+125

    1. Initial program 38.0

      \[\sqrt{\frac{w \cdot \left(\left(v - m\right) \cdot \left(v - m\right)\right)}{t}}\]
    2. Using strategy rm
    3. Applied associate-*r*37.2

      \[\leadsto \sqrt{\frac{\color{blue}{\left(w \cdot \left(v - m\right)\right) \cdot \left(v - m\right)}}{t}}\]
    4. Using strategy rm
    5. Applied div-inv37.2

      \[\leadsto \sqrt{\color{blue}{\left(\left(w \cdot \left(v - m\right)\right) \cdot \left(v - m\right)\right) \cdot \frac{1}{t}}}\]
    6. Applied sqrt-prod28.0

      \[\leadsto \color{blue}{\sqrt{\left(w \cdot \left(v - m\right)\right) \cdot \left(v - m\right)} \cdot \sqrt{\frac{1}{t}}}\]

    if 2.7535299051995598e+125 < w

    1. Initial program 46.1

      \[\sqrt{\frac{w \cdot \left(\left(v - m\right) \cdot \left(v - m\right)\right)}{t}}\]
    2. Using strategy rm
    3. Applied add-cube-cbrt46.3

      \[\leadsto \sqrt{\frac{w \cdot \left(\left(v - m\right) \cdot \left(v - m\right)\right)}{\color{blue}{\left(\sqrt[3]{t} \cdot \sqrt[3]{t}\right) \cdot \sqrt[3]{t}}}}\]
    4. Applied times-frac42.2

      \[\leadsto \sqrt{\color{blue}{\frac{w}{\sqrt[3]{t} \cdot \sqrt[3]{t}} \cdot \frac{\left(v - m\right) \cdot \left(v - m\right)}{\sqrt[3]{t}}}}\]
    5. Applied sqrt-prod33.5

      \[\leadsto \color{blue}{\sqrt{\frac{w}{\sqrt[3]{t} \cdot \sqrt[3]{t}}} \cdot \sqrt{\frac{\left(v - m\right) \cdot \left(v - m\right)}{\sqrt[3]{t}}}}\]
  3. Recombined 5 regimes into one program.
  4. Final simplification25.9

    \[\leadsto \begin{array}{l} \mathbf{if}\;w \le -2.143944468090101249010401365732409537263 \cdot 10^{-310}:\\ \;\;\;\;\sqrt{\frac{w \cdot \left(v - m\right)}{\sqrt[3]{t} \cdot \sqrt[3]{t}} \cdot \frac{v - m}{\sqrt[3]{t}}}\\ \mathbf{elif}\;w \le 4.484078778607641341976518811226128687364 \cdot 10^{-144}:\\ \;\;\;\;\frac{\sqrt{\left(w \cdot \left(v - m\right)\right) \cdot \left(v - m\right)}}{\sqrt{t}}\\ \mathbf{elif}\;w \le 5.564182326867624870557797113265992236836 \cdot 10^{-33}:\\ \;\;\;\;\sqrt{\frac{w \cdot \left(v - m\right)}{\frac{t}{v - m}}}\\ \mathbf{elif}\;w \le 2.753529905199559784711065200240629840758 \cdot 10^{125}:\\ \;\;\;\;\sqrt{\left(w \cdot \left(v - m\right)\right) \cdot \left(v - m\right)} \cdot \sqrt{\frac{1}{t}}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\frac{w}{\sqrt[3]{t} \cdot \sqrt[3]{t}}} \cdot \sqrt{\frac{\left(v - m\right) \cdot \left(v - m\right)}{\sqrt[3]{t}}}\\ \end{array}\]

Reproduce

herbie shell --seed 1 
(FPCore (w v m t)
  :name "sqrt((w * ((v - m) * (v - m))) / t)"
  :precision binary64
  (sqrt (/ (* w (* (- v m) (- v m))) t)))