Average Error: 24.6 → 7.1
Time: 5.1s
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.1890101961612443 \cdot 10^{88}:\\ \;\;\;\;-1 \cdot \left(x \cdot y\right)\\ \mathbf{elif}\;z \le 4.5181325422403336 \cdot 10^{112}:\\ \;\;\;\;\frac{x \cdot y}{\left|\sqrt[3]{z \cdot z - t \cdot a}\right|} \cdot \frac{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 -2.1890101961612443 \cdot 10^{88}:\\
\;\;\;\;-1 \cdot \left(x \cdot y\right)\\

\mathbf{elif}\;z \le 4.5181325422403336 \cdot 10^{112}:\\
\;\;\;\;\frac{x \cdot y}{\left|\sqrt[3]{z \cdot z - t \cdot a}\right|} \cdot \frac{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 r274267 = x;
        double r274268 = y;
        double r274269 = r274267 * r274268;
        double r274270 = z;
        double r274271 = r274269 * r274270;
        double r274272 = r274270 * r274270;
        double r274273 = t;
        double r274274 = a;
        double r274275 = r274273 * r274274;
        double r274276 = r274272 - r274275;
        double r274277 = sqrt(r274276);
        double r274278 = r274271 / r274277;
        return r274278;
}

double f(double x, double y, double z, double t, double a) {
        double r274279 = z;
        double r274280 = -2.1890101961612443e+88;
        bool r274281 = r274279 <= r274280;
        double r274282 = -1.0;
        double r274283 = x;
        double r274284 = y;
        double r274285 = r274283 * r274284;
        double r274286 = r274282 * r274285;
        double r274287 = 4.518132542240334e+112;
        bool r274288 = r274279 <= r274287;
        double r274289 = r274279 * r274279;
        double r274290 = t;
        double r274291 = a;
        double r274292 = r274290 * r274291;
        double r274293 = r274289 - r274292;
        double r274294 = cbrt(r274293);
        double r274295 = fabs(r274294);
        double r274296 = r274285 / r274295;
        double r274297 = sqrt(r274294);
        double r274298 = r274279 / r274297;
        double r274299 = r274296 * r274298;
        double r274300 = r274288 ? r274299 : r274285;
        double r274301 = r274281 ? r274286 : r274300;
        return r274301;
}

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.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 < -2.1890101961612443e+88

    1. Initial program 41.5

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

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

    if -2.1890101961612443e+88 < z < 4.518132542240334e+112

    1. Initial program 11.0

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

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

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

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

      \[\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 *-un-lft-identity9.8

      \[\leadsto \left(x \cdot y\right) \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}}}\]
    11. Applied times-frac9.8

      \[\leadsto \left(x \cdot y\right) \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)}\]
    12. Applied associate-*r*10.6

      \[\leadsto \color{blue}{\left(\left(x \cdot y\right) \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}}}}\]
    13. Simplified10.6

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

    if 4.518132542240334e+112 < z

    1. Initial program 45.6

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

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

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

Reproduce

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