Average Error: 24.0 → 6.2
Time: 18.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.37356901340721276315596241277867151448 \cdot 10^{144}:\\ \;\;\;\;-x \cdot y\\ \mathbf{elif}\;z \le 1.188073154399654890634910572185761354092 \cdot 10^{66}:\\ \;\;\;\;\frac{x}{\frac{\frac{\sqrt[3]{\sqrt{z \cdot z - t \cdot a}} \cdot \sqrt[3]{\sqrt{z \cdot z - t \cdot a}}}{\sqrt[3]{z} \cdot \sqrt[3]{z}}}{\frac{y}{\frac{\sqrt[3]{\sqrt{z \cdot z - t \cdot a}}}{\sqrt[3]{z}}}}}\\ \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.37356901340721276315596241277867151448 \cdot 10^{144}:\\
\;\;\;\;-x \cdot y\\

\mathbf{elif}\;z \le 1.188073154399654890634910572185761354092 \cdot 10^{66}:\\
\;\;\;\;\frac{x}{\frac{\frac{\sqrt[3]{\sqrt{z \cdot z - t \cdot a}} \cdot \sqrt[3]{\sqrt{z \cdot z - t \cdot a}}}{\sqrt[3]{z} \cdot \sqrt[3]{z}}}{\frac{y}{\frac{\sqrt[3]{\sqrt{z \cdot z - t \cdot a}}}{\sqrt[3]{z}}}}}\\

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

\end{array}
double f(double x, double y, double z, double t, double a) {
        double r160514 = x;
        double r160515 = y;
        double r160516 = r160514 * r160515;
        double r160517 = z;
        double r160518 = r160516 * r160517;
        double r160519 = r160517 * r160517;
        double r160520 = t;
        double r160521 = a;
        double r160522 = r160520 * r160521;
        double r160523 = r160519 - r160522;
        double r160524 = sqrt(r160523);
        double r160525 = r160518 / r160524;
        return r160525;
}

double f(double x, double y, double z, double t, double a) {
        double r160526 = z;
        double r160527 = -5.373569013407213e+144;
        bool r160528 = r160526 <= r160527;
        double r160529 = x;
        double r160530 = y;
        double r160531 = r160529 * r160530;
        double r160532 = -r160531;
        double r160533 = 1.1880731543996549e+66;
        bool r160534 = r160526 <= r160533;
        double r160535 = r160526 * r160526;
        double r160536 = t;
        double r160537 = a;
        double r160538 = r160536 * r160537;
        double r160539 = r160535 - r160538;
        double r160540 = sqrt(r160539);
        double r160541 = cbrt(r160540);
        double r160542 = r160541 * r160541;
        double r160543 = cbrt(r160526);
        double r160544 = r160543 * r160543;
        double r160545 = r160542 / r160544;
        double r160546 = r160541 / r160543;
        double r160547 = r160530 / r160546;
        double r160548 = r160545 / r160547;
        double r160549 = r160529 / r160548;
        double r160550 = r160530 * r160529;
        double r160551 = r160534 ? r160549 : r160550;
        double r160552 = r160528 ? r160532 : r160551;
        return r160552;
}

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.0
Target7.6
Herbie6.2
\[\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 < -5.373569013407213e+144

    1. Initial program 50.5

      \[\frac{\left(x \cdot y\right) \cdot z}{\sqrt{z \cdot z - t \cdot a}}\]
    2. Using strategy rm
    3. Applied associate-/l*49.1

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

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

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

    if -5.373569013407213e+144 < z < 1.1880731543996549e+66

    1. Initial program 10.6

      \[\frac{\left(x \cdot y\right) \cdot z}{\sqrt{z \cdot z - t \cdot a}}\]
    2. Using strategy rm
    3. Applied associate-/l*9.2

      \[\leadsto \color{blue}{\frac{x \cdot y}{\frac{\sqrt{z \cdot z - t \cdot a}}{z}}}\]
    4. Using strategy rm
    5. Applied associate-/l*9.2

      \[\leadsto \color{blue}{\frac{x}{\frac{\frac{\sqrt{z \cdot z - t \cdot a}}{z}}{y}}}\]
    6. Using strategy rm
    7. Applied add-cube-cbrt9.9

      \[\leadsto \frac{x}{\frac{\frac{\sqrt{z \cdot z - t \cdot a}}{\color{blue}{\left(\sqrt[3]{z} \cdot \sqrt[3]{z}\right) \cdot \sqrt[3]{z}}}}{y}}\]
    8. Applied add-cube-cbrt9.5

      \[\leadsto \frac{x}{\frac{\frac{\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}}}}{\left(\sqrt[3]{z} \cdot \sqrt[3]{z}\right) \cdot \sqrt[3]{z}}}{y}}\]
    9. Applied times-frac9.5

      \[\leadsto \frac{x}{\frac{\color{blue}{\frac{\sqrt[3]{\sqrt{z \cdot z - t \cdot a}} \cdot \sqrt[3]{\sqrt{z \cdot z - t \cdot a}}}{\sqrt[3]{z} \cdot \sqrt[3]{z}} \cdot \frac{\sqrt[3]{\sqrt{z \cdot z - t \cdot a}}}{\sqrt[3]{z}}}}{y}}\]
    10. Applied associate-/l*8.7

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

    if 1.1880731543996549e+66 < z

    1. Initial program 39.2

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

      \[\leadsto \color{blue}{x \cdot y}\]
    3. Simplified3.2

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \le -5.37356901340721276315596241277867151448 \cdot 10^{144}:\\ \;\;\;\;-x \cdot y\\ \mathbf{elif}\;z \le 1.188073154399654890634910572185761354092 \cdot 10^{66}:\\ \;\;\;\;\frac{x}{\frac{\frac{\sqrt[3]{\sqrt{z \cdot z - t \cdot a}} \cdot \sqrt[3]{\sqrt{z \cdot z - t \cdot a}}}{\sqrt[3]{z} \cdot \sqrt[3]{z}}}{\frac{y}{\frac{\sqrt[3]{\sqrt{z \cdot z - t \cdot a}}}{\sqrt[3]{z}}}}}\\ \mathbf{else}:\\ \;\;\;\;y \cdot x\\ \end{array}\]

Reproduce

herbie shell --seed 2019306 +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.1921305903852764e46) (- (* y x)) (if (< z 5.9762681209208942e90) (/ (* x z) (/ (sqrt (- (* z z) (* a t))) y)) (* y x)))

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