Average Error: 24.8 → 7.2
Time: 4.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.1055887578016406 \cdot 10^{87}:\\ \;\;\;\;x \cdot \left(-1 \cdot y\right)\\ \mathbf{elif}\;z \le 8.0013809758777307 \cdot 10^{126}:\\ \;\;\;\;\frac{\left(x \cdot y\right) \cdot \left(\sqrt[3]{z} \cdot \sqrt[3]{z}\right)}{\left|\sqrt[3]{z \cdot z - t \cdot a}\right|} \cdot \frac{\sqrt[3]{z}}{\sqrt{\sqrt[3]{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.1055887578016406 \cdot 10^{87}:\\
\;\;\;\;x \cdot \left(-1 \cdot y\right)\\

\mathbf{elif}\;z \le 8.0013809758777307 \cdot 10^{126}:\\
\;\;\;\;\frac{\left(x \cdot y\right) \cdot \left(\sqrt[3]{z} \cdot \sqrt[3]{z}\right)}{\left|\sqrt[3]{z \cdot z - t \cdot a}\right|} \cdot \frac{\sqrt[3]{z}}{\sqrt{\sqrt[3]{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 r288357 = x;
        double r288358 = y;
        double r288359 = r288357 * r288358;
        double r288360 = z;
        double r288361 = r288359 * r288360;
        double r288362 = r288360 * r288360;
        double r288363 = t;
        double r288364 = a;
        double r288365 = r288363 * r288364;
        double r288366 = r288362 - r288365;
        double r288367 = sqrt(r288366);
        double r288368 = r288361 / r288367;
        return r288368;
}

double f(double x, double y, double z, double t, double a) {
        double r288369 = z;
        double r288370 = -1.1055887578016406e+87;
        bool r288371 = r288369 <= r288370;
        double r288372 = x;
        double r288373 = -1.0;
        double r288374 = y;
        double r288375 = r288373 * r288374;
        double r288376 = r288372 * r288375;
        double r288377 = 8.001380975877731e+126;
        bool r288378 = r288369 <= r288377;
        double r288379 = r288372 * r288374;
        double r288380 = cbrt(r288369);
        double r288381 = r288380 * r288380;
        double r288382 = r288379 * r288381;
        double r288383 = r288369 * r288369;
        double r288384 = t;
        double r288385 = a;
        double r288386 = r288384 * r288385;
        double r288387 = r288383 - r288386;
        double r288388 = cbrt(r288387);
        double r288389 = fabs(r288388);
        double r288390 = r288382 / r288389;
        double r288391 = sqrt(r288388);
        double r288392 = r288380 / r288391;
        double r288393 = r288390 * r288392;
        double r288394 = r288378 ? r288393 : r288379;
        double r288395 = r288371 ? r288376 : r288394;
        return r288395;
}

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.8
Target7.8
Herbie7.2
\[\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 < -1.1055887578016406e+87

    1. Initial program 40.6

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

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

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

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

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

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

    if -1.1055887578016406e+87 < z < 8.001380975877731e+126

    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-frac9.6

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

      \[\leadsto \left(x \cdot y\right) \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}}}}\]
    9. Applied sqrt-prod10.0

      \[\leadsto \left(x \cdot y\right) \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}}}}\]
    10. Applied add-cube-cbrt10.3

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

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

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

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

    if 8.001380975877731e+126 < z

    1. Initial program 47.2

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

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

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

Reproduce

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