Average Error: 25.7 → 7.0
Time: 19.7s
Precision: 64
\[\frac{\left(x \cdot y\right) \cdot z}{\sqrt{z \cdot z - t \cdot a}}\]
\[\begin{array}{l} \mathbf{if}\;z \le -1.631171194470569263954315566738703264937 \cdot 10^{164}:\\ \;\;\;\;\left(-x\right) \cdot y\\ \mathbf{elif}\;z \le 5.492884630545356229744608925100127963585 \cdot 10^{148}:\\ \;\;\;\;\frac{z}{\sqrt{z \cdot z - t \cdot a}} \cdot \left(x \cdot y\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot y\\ \end{array}\]
\frac{\left(x \cdot y\right) \cdot z}{\sqrt{z \cdot z - t \cdot a}}
\begin{array}{l}
\mathbf{if}\;z \le -1.631171194470569263954315566738703264937 \cdot 10^{164}:\\
\;\;\;\;\left(-x\right) \cdot y\\

\mathbf{elif}\;z \le 5.492884630545356229744608925100127963585 \cdot 10^{148}:\\
\;\;\;\;\frac{z}{\sqrt{z \cdot z - t \cdot a}} \cdot \left(x \cdot y\right)\\

\mathbf{else}:\\
\;\;\;\;x \cdot y\\

\end{array}
double f(double x, double y, double z, double t, double a) {
        double r16145927 = x;
        double r16145928 = y;
        double r16145929 = r16145927 * r16145928;
        double r16145930 = z;
        double r16145931 = r16145929 * r16145930;
        double r16145932 = r16145930 * r16145930;
        double r16145933 = t;
        double r16145934 = a;
        double r16145935 = r16145933 * r16145934;
        double r16145936 = r16145932 - r16145935;
        double r16145937 = sqrt(r16145936);
        double r16145938 = r16145931 / r16145937;
        return r16145938;
}

double f(double x, double y, double z, double t, double a) {
        double r16145939 = z;
        double r16145940 = -1.6311711944705693e+164;
        bool r16145941 = r16145939 <= r16145940;
        double r16145942 = x;
        double r16145943 = -r16145942;
        double r16145944 = y;
        double r16145945 = r16145943 * r16145944;
        double r16145946 = 5.492884630545356e+148;
        bool r16145947 = r16145939 <= r16145946;
        double r16145948 = r16145939 * r16145939;
        double r16145949 = t;
        double r16145950 = a;
        double r16145951 = r16145949 * r16145950;
        double r16145952 = r16145948 - r16145951;
        double r16145953 = sqrt(r16145952);
        double r16145954 = r16145939 / r16145953;
        double r16145955 = r16145942 * r16145944;
        double r16145956 = r16145954 * r16145955;
        double r16145957 = r16145947 ? r16145956 : r16145955;
        double r16145958 = r16145941 ? r16145945 : r16145957;
        return r16145958;
}

Error

Bits error versus x

Bits error versus y

Bits error versus z

Bits error versus t

Bits error versus a

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original25.7
Target8.1
Herbie7.0
\[\begin{array}{l} \mathbf{if}\;z \lt -3.192130590385276419686361646843883646209 \cdot 10^{46}:\\ \;\;\;\;-y \cdot x\\ \mathbf{elif}\;z \lt 5.976268120920894210257945708950453212935 \cdot 10^{90}:\\ \;\;\;\;\frac{x \cdot z}{\frac{\sqrt{z \cdot z - a \cdot t}}{y}}\\ \mathbf{else}:\\ \;\;\;\;y \cdot x\\ \end{array}\]

Derivation

  1. Split input into 3 regimes
  2. if z < -1.6311711944705693e+164

    1. Initial program 53.5

      \[\frac{\left(x \cdot y\right) \cdot z}{\sqrt{z \cdot z - t \cdot a}}\]
    2. Using strategy rm
    3. Applied add-cube-cbrt53.5

      \[\leadsto \frac{\left(x \cdot y\right) \cdot z}{\color{blue}{\left(\sqrt[3]{\sqrt{z \cdot z - t \cdot a}} \cdot \sqrt[3]{\sqrt{z \cdot z - t \cdot a}}\right) \cdot \sqrt[3]{\sqrt{z \cdot z - t \cdot a}}}}\]
    4. Applied times-frac53.1

      \[\leadsto \color{blue}{\frac{x \cdot y}{\sqrt[3]{\sqrt{z \cdot z - t \cdot a}} \cdot \sqrt[3]{\sqrt{z \cdot z - t \cdot a}}} \cdot \frac{z}{\sqrt[3]{\sqrt{z \cdot z - t \cdot a}}}}\]
    5. Taylor expanded around -inf 1.1

      \[\leadsto \color{blue}{-1 \cdot \left(x \cdot y\right)}\]
    6. Simplified1.1

      \[\leadsto \color{blue}{\left(-x\right) \cdot y}\]

    if -1.6311711944705693e+164 < z < 5.492884630545356e+148

    1. Initial program 12.3

      \[\frac{\left(x \cdot y\right) \cdot z}{\sqrt{z \cdot z - t \cdot a}}\]
    2. Using strategy rm
    3. Applied *-un-lft-identity12.3

      \[\leadsto \frac{\left(x \cdot y\right) \cdot z}{\sqrt{\color{blue}{1 \cdot \left(z \cdot z - t \cdot a\right)}}}\]
    4. Applied sqrt-prod12.3

      \[\leadsto \frac{\left(x \cdot y\right) \cdot z}{\color{blue}{\sqrt{1} \cdot \sqrt{z \cdot z - t \cdot a}}}\]
    5. Applied times-frac9.8

      \[\leadsto \color{blue}{\frac{x \cdot y}{\sqrt{1}} \cdot \frac{z}{\sqrt{z \cdot z - t \cdot a}}}\]
    6. Simplified9.8

      \[\leadsto \color{blue}{\left(y \cdot x\right)} \cdot \frac{z}{\sqrt{z \cdot z - t \cdot a}}\]

    if 5.492884630545356e+148 < z

    1. Initial program 53.5

      \[\frac{\left(x \cdot y\right) \cdot z}{\sqrt{z \cdot z - t \cdot a}}\]
    2. Taylor expanded around inf 1.5

      \[\leadsto \color{blue}{x \cdot y}\]
  3. Recombined 3 regimes into one program.
  4. Final simplification7.0

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \le -1.631171194470569263954315566738703264937 \cdot 10^{164}:\\ \;\;\;\;\left(-x\right) \cdot y\\ \mathbf{elif}\;z \le 5.492884630545356229744608925100127963585 \cdot 10^{148}:\\ \;\;\;\;\frac{z}{\sqrt{z \cdot z - t \cdot a}} \cdot \left(x \cdot y\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot y\\ \end{array}\]

Reproduce

herbie shell --seed 2019174 
(FPCore (x y z t a)
  :name "Statistics.Math.RootFinding:ridders from math-functions-0.1.5.2"

  :herbie-target
  (if (< z -3.1921305903852764e+46) (- (* y x)) (if (< z 5.976268120920894e+90) (/ (* x z) (/ (sqrt (- (* z z) (* a t))) y)) (* y x)))

  (/ (* (* x y) z) (sqrt (- (* z z) (* t a)))))