Average Error: 25.5 → 5.7
Time: 6.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 -3.30855613287552178 \cdot 10^{104}:\\ \;\;\;\;-x \cdot y\\ \mathbf{elif}\;z \le 6.3074422229433126 \cdot 10^{112}:\\ \;\;\;\;\left(x \cdot \left(y \cdot \frac{\sqrt[3]{z} \cdot \sqrt[3]{z}}{\left|\sqrt[3]{z \cdot z - t \cdot a}\right|}\right)\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 -3.30855613287552178 \cdot 10^{104}:\\
\;\;\;\;-x \cdot y\\

\mathbf{elif}\;z \le 6.3074422229433126 \cdot 10^{112}:\\
\;\;\;\;\left(x \cdot \left(y \cdot \frac{\sqrt[3]{z} \cdot \sqrt[3]{z}}{\left|\sqrt[3]{z \cdot z - t \cdot a}\right|}\right)\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 r385454 = x;
        double r385455 = y;
        double r385456 = r385454 * r385455;
        double r385457 = z;
        double r385458 = r385456 * r385457;
        double r385459 = r385457 * r385457;
        double r385460 = t;
        double r385461 = a;
        double r385462 = r385460 * r385461;
        double r385463 = r385459 - r385462;
        double r385464 = sqrt(r385463);
        double r385465 = r385458 / r385464;
        return r385465;
}

double f(double x, double y, double z, double t, double a) {
        double r385466 = z;
        double r385467 = -3.308556132875522e+104;
        bool r385468 = r385466 <= r385467;
        double r385469 = x;
        double r385470 = y;
        double r385471 = r385469 * r385470;
        double r385472 = -r385471;
        double r385473 = 6.307442222943313e+112;
        bool r385474 = r385466 <= r385473;
        double r385475 = cbrt(r385466);
        double r385476 = r385475 * r385475;
        double r385477 = r385466 * r385466;
        double r385478 = t;
        double r385479 = a;
        double r385480 = r385478 * r385479;
        double r385481 = r385477 - r385480;
        double r385482 = cbrt(r385481);
        double r385483 = fabs(r385482);
        double r385484 = r385476 / r385483;
        double r385485 = r385470 * r385484;
        double r385486 = r385469 * r385485;
        double r385487 = sqrt(r385482);
        double r385488 = r385475 / r385487;
        double r385489 = r385486 * r385488;
        double r385490 = r385474 ? r385489 : r385471;
        double r385491 = r385468 ? r385472 : r385490;
        return r385491;
}

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

Original25.5
Target7.6
Herbie5.7
\[\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 < -3.308556132875522e+104

    1. Initial program 44.2

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

      \[\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-prod44.2

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

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

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

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

    if -3.308556132875522e+104 < z < 6.307442222943313e+112

    1. Initial program 11.2

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

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

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

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

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

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

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

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

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

      \[\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. Simplified8.2

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

    if 6.307442222943313e+112 < z

    1. Initial program 46.4

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \le -3.30855613287552178 \cdot 10^{104}:\\ \;\;\;\;-x \cdot y\\ \mathbf{elif}\;z \le 6.3074422229433126 \cdot 10^{112}:\\ \;\;\;\;\left(x \cdot \left(y \cdot \frac{\sqrt[3]{z} \cdot \sqrt[3]{z}}{\left|\sqrt[3]{z \cdot z - t \cdot a}\right|}\right)\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 2020046 
(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)))))