Average Error: 24.5 → 6.1
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 -4.7649092939075702 \cdot 10^{58}:\\ \;\;\;\;-1 \cdot \left(x \cdot y\right)\\ \mathbf{elif}\;z \le 1.4676500402789059 \cdot 10^{97}:\\ \;\;\;\;\frac{x}{\frac{\sqrt{\sqrt{z \cdot z - t \cdot a}}}{\sqrt[3]{z} \cdot \sqrt[3]{z}}} \cdot \frac{y}{\frac{\sqrt{\sqrt{z \cdot z - t \cdot a}}}{\sqrt[3]{z}}}\\ \mathbf{else}:\\ \;\;\;\;\left(x \cdot y\right) \cdot 1\\ \end{array}\]
\frac{\left(x \cdot y\right) \cdot z}{\sqrt{z \cdot z - t \cdot a}}
\begin{array}{l}
\mathbf{if}\;z \le -4.7649092939075702 \cdot 10^{58}:\\
\;\;\;\;-1 \cdot \left(x \cdot y\right)\\

\mathbf{elif}\;z \le 1.4676500402789059 \cdot 10^{97}:\\
\;\;\;\;\frac{x}{\frac{\sqrt{\sqrt{z \cdot z - t \cdot a}}}{\sqrt[3]{z} \cdot \sqrt[3]{z}}} \cdot \frac{y}{\frac{\sqrt{\sqrt{z \cdot z - t \cdot a}}}{\sqrt[3]{z}}}\\

\mathbf{else}:\\
\;\;\;\;\left(x \cdot y\right) \cdot 1\\

\end{array}
double f(double x, double y, double z, double t, double a) {
        double r381460 = x;
        double r381461 = y;
        double r381462 = r381460 * r381461;
        double r381463 = z;
        double r381464 = r381462 * r381463;
        double r381465 = r381463 * r381463;
        double r381466 = t;
        double r381467 = a;
        double r381468 = r381466 * r381467;
        double r381469 = r381465 - r381468;
        double r381470 = sqrt(r381469);
        double r381471 = r381464 / r381470;
        return r381471;
}

double f(double x, double y, double z, double t, double a) {
        double r381472 = z;
        double r381473 = -4.76490929390757e+58;
        bool r381474 = r381472 <= r381473;
        double r381475 = -1.0;
        double r381476 = x;
        double r381477 = y;
        double r381478 = r381476 * r381477;
        double r381479 = r381475 * r381478;
        double r381480 = 1.4676500402789059e+97;
        bool r381481 = r381472 <= r381480;
        double r381482 = r381472 * r381472;
        double r381483 = t;
        double r381484 = a;
        double r381485 = r381483 * r381484;
        double r381486 = r381482 - r381485;
        double r381487 = sqrt(r381486);
        double r381488 = sqrt(r381487);
        double r381489 = cbrt(r381472);
        double r381490 = r381489 * r381489;
        double r381491 = r381488 / r381490;
        double r381492 = r381476 / r381491;
        double r381493 = r381488 / r381489;
        double r381494 = r381477 / r381493;
        double r381495 = r381492 * r381494;
        double r381496 = 1.0;
        double r381497 = r381478 * r381496;
        double r381498 = r381481 ? r381495 : r381497;
        double r381499 = r381474 ? r381479 : r381498;
        return r381499;
}

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.5
Target7.5
Herbie6.1
\[\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 < -4.76490929390757e+58

    1. Initial program 38.4

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

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

    if -4.76490929390757e+58 < z < 1.4676500402789059e+97

    1. Initial program 10.8

      \[\frac{\left(x \cdot y\right) \cdot z}{\sqrt{z \cdot z - t \cdot a}}\]
    2. Using strategy rm
    3. Applied associate-/l*9.7

      \[\leadsto \color{blue}{\frac{x \cdot y}{\frac{\sqrt{z \cdot z - t \cdot a}}{z}}}\]
    4. Using strategy rm
    5. Applied add-cube-cbrt10.4

      \[\leadsto \frac{x \cdot y}{\frac{\sqrt{z \cdot z - t \cdot a}}{\color{blue}{\left(\sqrt[3]{z} \cdot \sqrt[3]{z}\right) \cdot \sqrt[3]{z}}}}\]
    6. Applied add-sqr-sqrt10.4

      \[\leadsto \frac{x \cdot y}{\frac{\sqrt{\color{blue}{\sqrt{z \cdot z - t \cdot a} \cdot \sqrt{z \cdot z - t \cdot a}}}}{\left(\sqrt[3]{z} \cdot \sqrt[3]{z}\right) \cdot \sqrt[3]{z}}}\]
    7. Applied sqrt-prod10.4

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

      \[\leadsto \frac{x \cdot y}{\color{blue}{\frac{\sqrt{\sqrt{z \cdot z - t \cdot a}}}{\sqrt[3]{z} \cdot \sqrt[3]{z}} \cdot \frac{\sqrt{\sqrt{z \cdot z - t \cdot a}}}{\sqrt[3]{z}}}}\]
    9. Applied times-frac8.7

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

    if 1.4676500402789059e+97 < z

    1. Initial program 43.8

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \le -4.7649092939075702 \cdot 10^{58}:\\ \;\;\;\;-1 \cdot \left(x \cdot y\right)\\ \mathbf{elif}\;z \le 1.4676500402789059 \cdot 10^{97}:\\ \;\;\;\;\frac{x}{\frac{\sqrt{\sqrt{z \cdot z - t \cdot a}}}{\sqrt[3]{z} \cdot \sqrt[3]{z}}} \cdot \frac{y}{\frac{\sqrt{\sqrt{z \cdot z - t \cdot a}}}{\sqrt[3]{z}}}\\ \mathbf{else}:\\ \;\;\;\;\left(x \cdot y\right) \cdot 1\\ \end{array}\]

Reproduce

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