Average Error: 24.6 → 7.3
Time: 10.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 -2.97301002443429709 \cdot 10^{73}:\\ \;\;\;\;-y \cdot x\\ \mathbf{elif}\;z \le 2.9066318437014138 \cdot 10^{79}:\\ \;\;\;\;x \cdot \left(\frac{y}{\left|\sqrt[3]{{\left(\sqrt[3]{z \cdot z - t \cdot a}\right)}^{3}}\right|} \cdot \frac{z}{\sqrt{\sqrt[3]{z \cdot z - t \cdot a}}}\right)\\ \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 -2.97301002443429709 \cdot 10^{73}:\\
\;\;\;\;-y \cdot x\\

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

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

\end{array}
double f(double x, double y, double z, double t, double a) {
        double r354251 = x;
        double r354252 = y;
        double r354253 = r354251 * r354252;
        double r354254 = z;
        double r354255 = r354253 * r354254;
        double r354256 = r354254 * r354254;
        double r354257 = t;
        double r354258 = a;
        double r354259 = r354257 * r354258;
        double r354260 = r354256 - r354259;
        double r354261 = sqrt(r354260);
        double r354262 = r354255 / r354261;
        return r354262;
}

double f(double x, double y, double z, double t, double a) {
        double r354263 = z;
        double r354264 = -2.973010024434297e+73;
        bool r354265 = r354263 <= r354264;
        double r354266 = y;
        double r354267 = x;
        double r354268 = r354266 * r354267;
        double r354269 = -r354268;
        double r354270 = 2.9066318437014138e+79;
        bool r354271 = r354263 <= r354270;
        double r354272 = r354263 * r354263;
        double r354273 = t;
        double r354274 = a;
        double r354275 = r354273 * r354274;
        double r354276 = r354272 - r354275;
        double r354277 = cbrt(r354276);
        double r354278 = 3.0;
        double r354279 = pow(r354277, r354278);
        double r354280 = cbrt(r354279);
        double r354281 = fabs(r354280);
        double r354282 = r354266 / r354281;
        double r354283 = sqrt(r354277);
        double r354284 = r354263 / r354283;
        double r354285 = r354282 * r354284;
        double r354286 = r354267 * r354285;
        double r354287 = r354267 * r354266;
        double r354288 = r354271 ? r354286 : r354287;
        double r354289 = r354265 ? r354269 : r354288;
        return r354289;
}

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.6
Target7.9
Herbie7.3
\[\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 < -2.973010024434297e+73

    1. Initial program 39.9

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

      \[\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-prod39.9

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

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

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

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

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

    if -2.973010024434297e+73 < z < 2.9066318437014138e+79

    1. Initial program 11.4

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

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

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

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

      \[\leadsto x \cdot \left(y \cdot \frac{z}{\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)\]
    11. Applied sqrt-prod10.5

      \[\leadsto x \cdot \left(y \cdot \frac{z}{\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)\]
    12. Applied *-un-lft-identity10.5

      \[\leadsto x \cdot \left(y \cdot \frac{\color{blue}{1 \cdot z}}{\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)\]
    13. Applied times-frac10.5

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

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

      \[\leadsto x \cdot \left(\color{blue}{\frac{y}{\left|\sqrt[3]{z \cdot z - t \cdot a}\right|}} \cdot \frac{z}{\sqrt{\sqrt[3]{z \cdot z - t \cdot a}}}\right)\]
    16. Using strategy rm
    17. Applied add-cbrt-cube11.1

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

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

    if 2.9066318437014138e+79 < z

    1. Initial program 39.9

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

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

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

Reproduce

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