Average Error: 24.3 → 6.3
Time: 16.2s
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.340135447098756276910591543614756155713 \cdot 10^{154}:\\ \;\;\;\;-y \cdot x\\ \mathbf{elif}\;z \le 1.171929517275323183425491158459386867597 \cdot 10^{97}:\\ \;\;\;\;\left(\left(y \cdot x\right) \cdot \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}}}\right) \cdot \frac{\sqrt[3]{z}}{\sqrt[3]{\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 -1.340135447098756276910591543614756155713 \cdot 10^{154}:\\
\;\;\;\;-y \cdot x\\

\mathbf{elif}\;z \le 1.171929517275323183425491158459386867597 \cdot 10^{97}:\\
\;\;\;\;\left(\left(y \cdot x\right) \cdot \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}}}\right) \cdot \frac{\sqrt[3]{z}}{\sqrt[3]{\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 r188772 = x;
        double r188773 = y;
        double r188774 = r188772 * r188773;
        double r188775 = z;
        double r188776 = r188774 * r188775;
        double r188777 = r188775 * r188775;
        double r188778 = t;
        double r188779 = a;
        double r188780 = r188778 * r188779;
        double r188781 = r188777 - r188780;
        double r188782 = sqrt(r188781);
        double r188783 = r188776 / r188782;
        return r188783;
}

double f(double x, double y, double z, double t, double a) {
        double r188784 = z;
        double r188785 = -1.3401354470987563e+154;
        bool r188786 = r188784 <= r188785;
        double r188787 = y;
        double r188788 = x;
        double r188789 = r188787 * r188788;
        double r188790 = -r188789;
        double r188791 = 1.1719295172753232e+97;
        bool r188792 = r188784 <= r188791;
        double r188793 = cbrt(r188784);
        double r188794 = r188793 * r188793;
        double r188795 = r188784 * r188784;
        double r188796 = t;
        double r188797 = a;
        double r188798 = r188796 * r188797;
        double r188799 = r188795 - r188798;
        double r188800 = sqrt(r188799);
        double r188801 = cbrt(r188800);
        double r188802 = r188801 * r188801;
        double r188803 = r188794 / r188802;
        double r188804 = r188789 * r188803;
        double r188805 = r188793 / r188801;
        double r188806 = r188804 * r188805;
        double r188807 = r188788 * r188787;
        double r188808 = r188792 ? r188806 : r188807;
        double r188809 = r188786 ? r188790 : r188808;
        return r188809;
}

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.3
Target8.0
Herbie6.3
\[\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.3401354470987563e+154

    1. Initial program 53.4

      \[\frac{\left(x \cdot y\right) \cdot z}{\sqrt{z \cdot z - t \cdot a}}\]
    2. Using strategy rm
    3. Applied *-un-lft-identity53.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-prod53.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-frac53.0

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

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

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

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

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

    if -1.3401354470987563e+154 < z < 1.1719295172753232e+97

    1. Initial program 11.3

      \[\frac{\left(x \cdot y\right) \cdot z}{\sqrt{z \cdot z - t \cdot a}}\]
    2. Using strategy rm
    3. Applied *-un-lft-identity11.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-prod11.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.1

      \[\leadsto \color{blue}{\frac{x \cdot y}{\sqrt{1}} \cdot \frac{z}{\sqrt{z \cdot z - t \cdot a}}}\]
    6. Simplified9.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-cbrt9.8

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

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

      \[\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. Applied associate-*r*8.7

      \[\leadsto \color{blue}{\left(\left(y \cdot x\right) \cdot \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}}}\right) \cdot \frac{\sqrt[3]{z}}{\sqrt[3]{\sqrt{z \cdot z - t \cdot a}}}}\]

    if 1.1719295172753232e+97 < z

    1. Initial program 43.1

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \le -1.340135447098756276910591543614756155713 \cdot 10^{154}:\\ \;\;\;\;-y \cdot x\\ \mathbf{elif}\;z \le 1.171929517275323183425491158459386867597 \cdot 10^{97}:\\ \;\;\;\;\left(\left(y \cdot x\right) \cdot \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}}}\right) \cdot \frac{\sqrt[3]{z}}{\sqrt[3]{\sqrt{z \cdot z - t \cdot a}}}\\ \mathbf{else}:\\ \;\;\;\;x \cdot y\\ \end{array}\]

Reproduce

herbie shell --seed 2019323 +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)))))