Average Error: 24.7 → 7.6
Time: 4.4s
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 r275657 = x;
        double r275658 = y;
        double r275659 = r275657 * r275658;
        double r275660 = z;
        double r275661 = r275659 * r275660;
        double r275662 = r275660 * r275660;
        double r275663 = t;
        double r275664 = a;
        double r275665 = r275663 * r275664;
        double r275666 = r275662 - r275665;
        double r275667 = sqrt(r275666);
        double r275668 = r275661 / r275667;
        return r275668;
}

double f(double x, double y, double z, double t, double a) {
        double r275669 = z;
        double r275670 = -329128518468.4069;
        bool r275671 = r275669 <= r275670;
        double r275672 = -1.0;
        double r275673 = x;
        double r275674 = y;
        double r275675 = r275673 * r275674;
        double r275676 = r275672 * r275675;
        double r275677 = 1.507591943378104e+117;
        bool r275678 = r275669 <= r275677;
        double r275679 = r275669 * r275669;
        double r275680 = t;
        double r275681 = a;
        double r275682 = r275680 * r275681;
        double r275683 = r275679 - r275682;
        double r275684 = cbrt(r275683);
        double r275685 = fabs(r275684);
        double r275686 = sqrt(r275684);
        double r275687 = r275685 * r275686;
        double r275688 = sqrt(r275687);
        double r275689 = r275669 / r275688;
        double r275690 = r275674 * r275689;
        double r275691 = r275673 * r275690;
        double r275692 = sqrt(r275683);
        double r275693 = sqrt(r275692);
        double r275694 = r275691 / r275693;
        double r275695 = r275678 ? r275694 : r275675;
        double r275696 = r275671 ? r275676 : r275695;
        return r275696;
}

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. Using strategy rm
    3. Applied *-un-lft-identity33.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-prod33.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-frac30.4

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

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

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

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

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

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