Average Error: 24.7 → 7.6
Time: 10.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 -329128518468.406921:\\ \;\;\;\;-1 \cdot \left(x \cdot y\right)\\ \mathbf{elif}\;z \le 1.5075919433781039 \cdot 10^{117}:\\ \;\;\;\;\frac{x \cdot \left(y \cdot \frac{z}{\sqrt{\left|\sqrt[3]{z \cdot z - t \cdot a}\right| \cdot \sqrt{\sqrt[3]{z \cdot z - t \cdot a}}}}\right)}{\sqrt{\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 -329128518468.406921:\\
\;\;\;\;-1 \cdot \left(x \cdot y\right)\\

\mathbf{elif}\;z \le 1.5075919433781039 \cdot 10^{117}:\\
\;\;\;\;\frac{x \cdot \left(y \cdot \frac{z}{\sqrt{\left|\sqrt[3]{z \cdot z - t \cdot a}\right| \cdot \sqrt{\sqrt[3]{z \cdot z - t \cdot a}}}}\right)}{\sqrt{\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 r1489 = x;
        double r1490 = y;
        double r1491 = r1489 * r1490;
        double r1492 = z;
        double r1493 = r1491 * r1492;
        double r1494 = r1492 * r1492;
        double r1495 = t;
        double r1496 = a;
        double r1497 = r1495 * r1496;
        double r1498 = r1494 - r1497;
        double r1499 = sqrt(r1498);
        double r1500 = r1493 / r1499;
        return r1500;
}

double f(double x, double y, double z, double t, double a) {
        double r1501 = z;
        double r1502 = -329128518468.4069;
        bool r1503 = r1501 <= r1502;
        double r1504 = -1.0;
        double r1505 = x;
        double r1506 = y;
        double r1507 = r1505 * r1506;
        double r1508 = r1504 * r1507;
        double r1509 = 1.507591943378104e+117;
        bool r1510 = r1501 <= r1509;
        double r1511 = r1501 * r1501;
        double r1512 = t;
        double r1513 = a;
        double r1514 = r1512 * r1513;
        double r1515 = r1511 - r1514;
        double r1516 = cbrt(r1515);
        double r1517 = fabs(r1516);
        double r1518 = sqrt(r1516);
        double r1519 = r1517 * r1518;
        double r1520 = sqrt(r1519);
        double r1521 = r1501 / r1520;
        double r1522 = r1506 * r1521;
        double r1523 = r1505 * r1522;
        double r1524 = sqrt(r1515);
        double r1525 = sqrt(r1524);
        double r1526 = r1523 / r1525;
        double r1527 = r1510 ? r1526 : r1507;
        double r1528 = r1503 ? r1508 : r1527;
        return r1528;
}

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.7
Target8.0
Herbie7.6
\[\begin{array}{l} \mathbf{if}\;z \lt -3.1921305903852764 \cdot 10^{46}:\\ \;\;\;\;-y \cdot x\\ \mathbf{elif}\;z \lt 5.9762681209208942 \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 < -329128518468.4069

    1. Initial program 33.3

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

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

    if -329128518468.4069 < z < 1.507591943378104e+117

    1. Initial program 11.8

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

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

      \[\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 add-sqr-sqrt10.6

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

      \[\leadsto \left(x \cdot y\right) \cdot \frac{z}{\color{blue}{\sqrt{\sqrt{z \cdot z - t \cdot a}} \cdot \sqrt{\sqrt{z \cdot z - t \cdot a}}}}\]
    10. Applied *-un-lft-identity10.8

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

      \[\leadsto \left(x \cdot y\right) \cdot \color{blue}{\left(\frac{1}{\sqrt{\sqrt{z \cdot z - t \cdot a}}} \cdot \frac{z}{\sqrt{\sqrt{z \cdot z - t \cdot a}}}\right)}\]
    12. Using strategy rm
    13. Applied associate-*r/10.9

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

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

      \[\leadsto \frac{\color{blue}{x \cdot \left(y \cdot \frac{z}{\sqrt{\sqrt{z \cdot z - t \cdot a}}}\right)}}{\sqrt{\sqrt{z \cdot z - t \cdot a}}}\]
    16. Using strategy rm
    17. Applied add-cube-cbrt11.0

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

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

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

    if 1.507591943378104e+117 < z

    1. Initial program 46.0

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \le -329128518468.406921:\\ \;\;\;\;-1 \cdot \left(x \cdot y\right)\\ \mathbf{elif}\;z \le 1.5075919433781039 \cdot 10^{117}:\\ \;\;\;\;\frac{x \cdot \left(y \cdot \frac{z}{\sqrt{\left|\sqrt[3]{z \cdot z - t \cdot a}\right| \cdot \sqrt{\sqrt[3]{z \cdot z - t \cdot a}}}}\right)}{\sqrt{\sqrt{z \cdot z - t \cdot a}}}\\ \mathbf{else}:\\ \;\;\;\;x \cdot y\\ \end{array}\]

Reproduce

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