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

\mathbf{elif}\;z \le 2.9066318437014138 \cdot 10^{79}:\\
\;\;\;\;x \cdot \left(\frac{y}{\left|\sqrt[3]{{\left(\sqrt[3]{{z}^{2} - a \cdot t}\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 r364335 = x;
        double r364336 = y;
        double r364337 = r364335 * r364336;
        double r364338 = z;
        double r364339 = r364337 * r364338;
        double r364340 = r364338 * r364338;
        double r364341 = t;
        double r364342 = a;
        double r364343 = r364341 * r364342;
        double r364344 = r364340 - r364343;
        double r364345 = sqrt(r364344);
        double r364346 = r364339 / r364345;
        return r364346;
}

double f(double x, double y, double z, double t, double a) {
        double r364347 = z;
        double r364348 = -2.973010024434297e+73;
        bool r364349 = r364347 <= r364348;
        double r364350 = x;
        double r364351 = y;
        double r364352 = r364350 * r364351;
        double r364353 = -r364352;
        double r364354 = 2.9066318437014138e+79;
        bool r364355 = r364347 <= r364354;
        double r364356 = 2.0;
        double r364357 = pow(r364347, r364356);
        double r364358 = a;
        double r364359 = t;
        double r364360 = r364358 * r364359;
        double r364361 = r364357 - r364360;
        double r364362 = cbrt(r364361);
        double r364363 = 3.0;
        double r364364 = pow(r364362, r364363);
        double r364365 = cbrt(r364364);
        double r364366 = fabs(r364365);
        double r364367 = r364351 / r364366;
        double r364368 = r364347 * r364347;
        double r364369 = r364359 * r364358;
        double r364370 = r364368 - r364369;
        double r364371 = cbrt(r364370);
        double r364372 = sqrt(r364371);
        double r364373 = r364347 / r364372;
        double r364374 = r364367 * r364373;
        double r364375 = r364350 * r364374;
        double r364376 = r364355 ? r364375 : r364352;
        double r364377 = r364349 ? r364353 : r364376;
        return r364377;
}

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 \left(x \cdot y\right) \cdot \color{blue}{-1}\]

    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}^{2} - a \cdot t}\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. 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.8

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \le -2.97301002443429709 \cdot 10^{73}:\\ \;\;\;\;-x \cdot y\\ \mathbf{elif}\;z \le 2.9066318437014138 \cdot 10^{79}:\\ \;\;\;\;x \cdot \left(\frac{y}{\left|\sqrt[3]{{\left(\sqrt[3]{{z}^{2} - a \cdot t}\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 
(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)))))