Average Error: 24.1 → 7.1
Time: 4.9s
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.841072424480832961575433736923648161714 \cdot 10^{103}:\\ \;\;\;\;x \cdot \left(-1 \cdot y\right)\\ \mathbf{elif}\;z \le 6.447720564522468628519061845818630465482 \cdot 10^{-228}:\\ \;\;\;\;x \cdot \left(\left(y \cdot \left(\sqrt[3]{\frac{z}{\sqrt{z \cdot z - t \cdot a}}} \cdot \sqrt[3]{\frac{z}{\sqrt{z \cdot z - t \cdot a}}}\right)\right) \cdot \sqrt[3]{\frac{z}{\sqrt{z \cdot z - t \cdot a}}}\right)\\ \mathbf{elif}\;z \le 3.417452118825496737383292257126227314234 \cdot 10^{-169}:\\ \;\;\;\;x \cdot y\\ \mathbf{elif}\;z \le 6.344623429916867054620353842811536561075 \cdot 10^{113}:\\ \;\;\;\;\left(x \cdot y\right) \cdot \frac{z}{\sqrt{z \cdot z - t \cdot a}}\\ \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 -5.841072424480832961575433736923648161714 \cdot 10^{103}:\\
\;\;\;\;x \cdot \left(-1 \cdot y\right)\\

\mathbf{elif}\;z \le 6.447720564522468628519061845818630465482 \cdot 10^{-228}:\\
\;\;\;\;x \cdot \left(\left(y \cdot \left(\sqrt[3]{\frac{z}{\sqrt{z \cdot z - t \cdot a}}} \cdot \sqrt[3]{\frac{z}{\sqrt{z \cdot z - t \cdot a}}}\right)\right) \cdot \sqrt[3]{\frac{z}{\sqrt{z \cdot z - t \cdot a}}}\right)\\

\mathbf{elif}\;z \le 3.417452118825496737383292257126227314234 \cdot 10^{-169}:\\
\;\;\;\;x \cdot y\\

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

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

\end{array}
double f(double x, double y, double z, double t, double a) {
        double r353579 = x;
        double r353580 = y;
        double r353581 = r353579 * r353580;
        double r353582 = z;
        double r353583 = r353581 * r353582;
        double r353584 = r353582 * r353582;
        double r353585 = t;
        double r353586 = a;
        double r353587 = r353585 * r353586;
        double r353588 = r353584 - r353587;
        double r353589 = sqrt(r353588);
        double r353590 = r353583 / r353589;
        return r353590;
}

double f(double x, double y, double z, double t, double a) {
        double r353591 = z;
        double r353592 = -5.841072424480833e+103;
        bool r353593 = r353591 <= r353592;
        double r353594 = x;
        double r353595 = -1.0;
        double r353596 = y;
        double r353597 = r353595 * r353596;
        double r353598 = r353594 * r353597;
        double r353599 = 6.447720564522469e-228;
        bool r353600 = r353591 <= r353599;
        double r353601 = r353591 * r353591;
        double r353602 = t;
        double r353603 = a;
        double r353604 = r353602 * r353603;
        double r353605 = r353601 - r353604;
        double r353606 = sqrt(r353605);
        double r353607 = r353591 / r353606;
        double r353608 = cbrt(r353607);
        double r353609 = r353608 * r353608;
        double r353610 = r353596 * r353609;
        double r353611 = r353610 * r353608;
        double r353612 = r353594 * r353611;
        double r353613 = 3.417452118825497e-169;
        bool r353614 = r353591 <= r353613;
        double r353615 = r353594 * r353596;
        double r353616 = 6.344623429916867e+113;
        bool r353617 = r353591 <= r353616;
        double r353618 = r353615 * r353607;
        double r353619 = r353617 ? r353618 : r353615;
        double r353620 = r353614 ? r353615 : r353619;
        double r353621 = r353600 ? r353612 : r353620;
        double r353622 = r353593 ? r353598 : r353621;
        return r353622;
}

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.1
Target7.4
Herbie7.1
\[\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 4 regimes
  2. if z < -5.841072424480833e+103

    1. Initial program 44.4

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

      \[\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-prod44.4

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

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

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

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

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

    if -5.841072424480833e+103 < z < 6.447720564522469e-228

    1. Initial program 11.6

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

      \[\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-prod11.6

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

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

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

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

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

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

    if 6.447720564522469e-228 < z < 3.417452118825497e-169 or 6.344623429916867e+113 < z

    1. Initial program 40.4

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

      \[\leadsto \color{blue}{x \cdot y}\]

    if 3.417452118825497e-169 < z < 6.344623429916867e+113

    1. Initial program 7.6

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

      \[\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-prod7.6

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

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

      \[\leadsto \color{blue}{\left(x \cdot y\right)} \cdot \frac{z}{\sqrt{z \cdot z - t \cdot a}}\]
  3. Recombined 4 regimes into one program.
  4. Final simplification7.1

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \le -5.841072424480832961575433736923648161714 \cdot 10^{103}:\\ \;\;\;\;x \cdot \left(-1 \cdot y\right)\\ \mathbf{elif}\;z \le 6.447720564522468628519061845818630465482 \cdot 10^{-228}:\\ \;\;\;\;x \cdot \left(\left(y \cdot \left(\sqrt[3]{\frac{z}{\sqrt{z \cdot z - t \cdot a}}} \cdot \sqrt[3]{\frac{z}{\sqrt{z \cdot z - t \cdot a}}}\right)\right) \cdot \sqrt[3]{\frac{z}{\sqrt{z \cdot z - t \cdot a}}}\right)\\ \mathbf{elif}\;z \le 3.417452118825496737383292257126227314234 \cdot 10^{-169}:\\ \;\;\;\;x \cdot y\\ \mathbf{elif}\;z \le 6.344623429916867054620353842811536561075 \cdot 10^{113}:\\ \;\;\;\;\left(x \cdot y\right) \cdot \frac{z}{\sqrt{z \cdot z - t \cdot a}}\\ \mathbf{else}:\\ \;\;\;\;x \cdot y\\ \end{array}\]

Reproduce

herbie shell --seed 2019354 +o rules:numerics
(FPCore (x y z t a)
  :name "Statistics.Math.RootFinding:ridders from math-functions-0.1.5.2"
  :precision binary64

  :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)))))