Average Error: 24.8 → 6.1
Time: 16.8s
Precision: 64
\[\frac{\left(x \cdot y\right) \cdot z}{\sqrt{z \cdot z - t \cdot a}}\]
\[\begin{array}{l} \mathbf{if}\;z \le -5.667193347780096 \cdot 10^{+153}:\\ \;\;\;\;y \cdot \left(-x\right)\\ \mathbf{elif}\;z \le -1.0059935812111571 \cdot 10^{-240}:\\ \;\;\;\;y \cdot \left(x \cdot \frac{z}{\sqrt{z \cdot z - t \cdot a}}\right)\\ \mathbf{elif}\;z \le 4.2013669449125285 \cdot 10^{-250}:\\ \;\;\;\;\frac{\frac{z \cdot \left(y \cdot x\right)}{\sqrt{\sqrt{z \cdot z - t \cdot a}}}}{\sqrt{\sqrt{z \cdot z - t \cdot a}}}\\ \mathbf{elif}\;z \le 9.659251240846705 \cdot 10^{+99}:\\ \;\;\;\;y \cdot \left(x \cdot \frac{z}{\sqrt{z \cdot z - t \cdot a}}\right)\\ \mathbf{else}:\\ \;\;\;\;y \cdot x\\ \end{array}\]
\frac{\left(x \cdot y\right) \cdot z}{\sqrt{z \cdot z - t \cdot a}}
\begin{array}{l}
\mathbf{if}\;z \le -5.667193347780096 \cdot 10^{+153}:\\
\;\;\;\;y \cdot \left(-x\right)\\

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

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

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

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

\end{array}
double f(double x, double y, double z, double t, double a) {
        double r13550676 = x;
        double r13550677 = y;
        double r13550678 = r13550676 * r13550677;
        double r13550679 = z;
        double r13550680 = r13550678 * r13550679;
        double r13550681 = r13550679 * r13550679;
        double r13550682 = t;
        double r13550683 = a;
        double r13550684 = r13550682 * r13550683;
        double r13550685 = r13550681 - r13550684;
        double r13550686 = sqrt(r13550685);
        double r13550687 = r13550680 / r13550686;
        return r13550687;
}

double f(double x, double y, double z, double t, double a) {
        double r13550688 = z;
        double r13550689 = -5.667193347780096e+153;
        bool r13550690 = r13550688 <= r13550689;
        double r13550691 = y;
        double r13550692 = x;
        double r13550693 = -r13550692;
        double r13550694 = r13550691 * r13550693;
        double r13550695 = -1.0059935812111571e-240;
        bool r13550696 = r13550688 <= r13550695;
        double r13550697 = r13550688 * r13550688;
        double r13550698 = t;
        double r13550699 = a;
        double r13550700 = r13550698 * r13550699;
        double r13550701 = r13550697 - r13550700;
        double r13550702 = sqrt(r13550701);
        double r13550703 = r13550688 / r13550702;
        double r13550704 = r13550692 * r13550703;
        double r13550705 = r13550691 * r13550704;
        double r13550706 = 4.2013669449125285e-250;
        bool r13550707 = r13550688 <= r13550706;
        double r13550708 = r13550691 * r13550692;
        double r13550709 = r13550688 * r13550708;
        double r13550710 = sqrt(r13550702);
        double r13550711 = r13550709 / r13550710;
        double r13550712 = r13550711 / r13550710;
        double r13550713 = 9.659251240846705e+99;
        bool r13550714 = r13550688 <= r13550713;
        double r13550715 = r13550714 ? r13550705 : r13550708;
        double r13550716 = r13550707 ? r13550712 : r13550715;
        double r13550717 = r13550696 ? r13550705 : r13550716;
        double r13550718 = r13550690 ? r13550694 : r13550717;
        return r13550718;
}

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

Original24.8
Target7.9
Herbie6.1
\[\begin{array}{l} \mathbf{if}\;z \lt -3.1921305903852764 \cdot 10^{+46}:\\ \;\;\;\;-y \cdot x\\ \mathbf{elif}\;z \lt 5.976268120920894 \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 4 regimes
  2. if z < -5.667193347780096e+153

    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 *-un-lft-identity53.5

      \[\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-prod53.5

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

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

      \[\leadsto \color{blue}{\left(y \cdot x\right)} \cdot \frac{z}{\sqrt{z \cdot z - t \cdot a}}\]
    7. Using strategy rm
    8. Applied associate-*l*53.5

      \[\leadsto \color{blue}{y \cdot \left(x \cdot \frac{z}{\sqrt{z \cdot z - t \cdot a}}\right)}\]
    9. Taylor expanded around -inf 1.0

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

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

    if -5.667193347780096e+153 < z < -1.0059935812111571e-240 or 4.2013669449125285e-250 < z < 9.659251240846705e+99

    1. Initial program 10.7

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

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

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

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

      \[\leadsto \color{blue}{\left(y \cdot x\right)} \cdot \frac{z}{\sqrt{z \cdot z - t \cdot a}}\]
    7. Using strategy rm
    8. Applied associate-*l*7.6

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

    if -1.0059935812111571e-240 < z < 4.2013669449125285e-250

    1. Initial program 15.8

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

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

      \[\leadsto \frac{\left(x \cdot y\right) \cdot z}{\color{blue}{\sqrt{\sqrt{z \cdot z - t \cdot a}} \cdot \sqrt{\sqrt{z \cdot z - t \cdot a}}}}\]
    5. Applied associate-/r*15.9

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

    if 9.659251240846705e+99 < z

    1. Initial program 43.9

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

      \[\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-prod43.9

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

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

      \[\leadsto \color{blue}{\left(y \cdot x\right)} \cdot \frac{z}{\sqrt{z \cdot z - t \cdot a}}\]
    7. Using strategy rm
    8. Applied add-cube-cbrt42.4

      \[\leadsto \left(y \cdot x\right) \cdot \frac{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}}}}\]
    9. Applied add-cube-cbrt42.2

      \[\leadsto \left(y \cdot x\right) \cdot \frac{\color{blue}{\left(\sqrt[3]{z} \cdot \sqrt[3]{z}\right) \cdot \sqrt[3]{z}}}{\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}}}\]
    10. Applied times-frac42.2

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

      \[\leadsto \left(y \cdot x\right) \cdot \left(\color{blue}{\left(\frac{\sqrt[3]{z}}{\sqrt[3]{\sqrt{z \cdot z - t \cdot a}}} \cdot \frac{\sqrt[3]{z}}{\sqrt[3]{\sqrt{z \cdot z - t \cdot a}}}\right)} \cdot \frac{\sqrt[3]{z}}{\sqrt[3]{\sqrt{z \cdot z - t \cdot a}}}\right)\]
    12. Taylor expanded around inf 2.4

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \le -5.667193347780096 \cdot 10^{+153}:\\ \;\;\;\;y \cdot \left(-x\right)\\ \mathbf{elif}\;z \le -1.0059935812111571 \cdot 10^{-240}:\\ \;\;\;\;y \cdot \left(x \cdot \frac{z}{\sqrt{z \cdot z - t \cdot a}}\right)\\ \mathbf{elif}\;z \le 4.2013669449125285 \cdot 10^{-250}:\\ \;\;\;\;\frac{\frac{z \cdot \left(y \cdot x\right)}{\sqrt{\sqrt{z \cdot z - t \cdot a}}}}{\sqrt{\sqrt{z \cdot z - t \cdot a}}}\\ \mathbf{elif}\;z \le 9.659251240846705 \cdot 10^{+99}:\\ \;\;\;\;y \cdot \left(x \cdot \frac{z}{\sqrt{z \cdot z - t \cdot a}}\right)\\ \mathbf{else}:\\ \;\;\;\;y \cdot x\\ \end{array}\]

Reproduce

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