Average Error: 24.6 → 7.5
Time: 7.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 -1.16524733009835821 \cdot 10^{113}:\\ \;\;\;\;-1 \cdot \left(x \cdot y\right)\\ \mathbf{elif}\;z \le 3.90238105065629941 \cdot 10^{82}:\\ \;\;\;\;\left(\frac{x \cdot \left(\sqrt[3]{1} \cdot \sqrt[3]{1}\right)}{\sqrt{\left|\sqrt[3]{z \cdot z - t \cdot a}\right|}} \cdot \frac{\sqrt[3]{1}}{\frac{\sqrt{\left|\sqrt[3]{z \cdot z - t \cdot a}\right|}}{y}}\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 -1.16524733009835821 \cdot 10^{113}:\\
\;\;\;\;-1 \cdot \left(x \cdot y\right)\\

\mathbf{elif}\;z \le 3.90238105065629941 \cdot 10^{82}:\\
\;\;\;\;\left(\frac{x \cdot \left(\sqrt[3]{1} \cdot \sqrt[3]{1}\right)}{\sqrt{\left|\sqrt[3]{z \cdot z - t \cdot a}\right|}} \cdot \frac{\sqrt[3]{1}}{\frac{\sqrt{\left|\sqrt[3]{z \cdot z - t \cdot a}\right|}}{y}}\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 r422201 = x;
        double r422202 = y;
        double r422203 = r422201 * r422202;
        double r422204 = z;
        double r422205 = r422203 * r422204;
        double r422206 = r422204 * r422204;
        double r422207 = t;
        double r422208 = a;
        double r422209 = r422207 * r422208;
        double r422210 = r422206 - r422209;
        double r422211 = sqrt(r422210);
        double r422212 = r422205 / r422211;
        return r422212;
}

double f(double x, double y, double z, double t, double a) {
        double r422213 = z;
        double r422214 = -1.1652473300983582e+113;
        bool r422215 = r422213 <= r422214;
        double r422216 = -1.0;
        double r422217 = x;
        double r422218 = y;
        double r422219 = r422217 * r422218;
        double r422220 = r422216 * r422219;
        double r422221 = 3.9023810506562994e+82;
        bool r422222 = r422213 <= r422221;
        double r422223 = 1.0;
        double r422224 = cbrt(r422223);
        double r422225 = r422224 * r422224;
        double r422226 = r422217 * r422225;
        double r422227 = r422213 * r422213;
        double r422228 = t;
        double r422229 = a;
        double r422230 = r422228 * r422229;
        double r422231 = r422227 - r422230;
        double r422232 = cbrt(r422231);
        double r422233 = fabs(r422232);
        double r422234 = sqrt(r422233);
        double r422235 = r422226 / r422234;
        double r422236 = r422234 / r422218;
        double r422237 = r422224 / r422236;
        double r422238 = r422235 * r422237;
        double r422239 = sqrt(r422232);
        double r422240 = r422213 / r422239;
        double r422241 = r422238 * r422240;
        double r422242 = r422222 ? r422241 : r422219;
        double r422243 = r422215 ? r422220 : r422242;
        return r422243;
}

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
Target8.0
Herbie7.5
\[\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.1652473300983582e+113

    1. Initial program 45.0

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

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

    if -1.1652473300983582e+113 < z < 3.9023810506562994e+82

    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 add-cube-cbrt11.8

      \[\leadsto \frac{\left(x \cdot y\right) \cdot 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}}}}\]
    4. Applied sqrt-prod11.8

      \[\leadsto \frac{\left(x \cdot y\right) \cdot 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}}}}\]
    5. Applied times-frac11.1

      \[\leadsto \color{blue}{\frac{x \cdot y}{\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}}}}\]
    6. Simplified11.6

      \[\leadsto \color{blue}{\frac{x}{\frac{\left|\sqrt[3]{z \cdot z - t \cdot a}\right|}{y}}} \cdot \frac{z}{\sqrt{\sqrt[3]{z \cdot z - t \cdot a}}}\]
    7. Using strategy rm
    8. Applied div-inv11.8

      \[\leadsto \color{blue}{\left(x \cdot \frac{1}{\frac{\left|\sqrt[3]{z \cdot z - t \cdot a}\right|}{y}}\right)} \cdot \frac{z}{\sqrt{\sqrt[3]{z \cdot z - t \cdot a}}}\]
    9. Using strategy rm
    10. Applied *-un-lft-identity11.8

      \[\leadsto \left(x \cdot \frac{1}{\frac{\left|\sqrt[3]{z \cdot z - t \cdot a}\right|}{\color{blue}{1 \cdot y}}}\right) \cdot \frac{z}{\sqrt{\sqrt[3]{z \cdot z - t \cdot a}}}\]
    11. Applied add-sqr-sqrt11.9

      \[\leadsto \left(x \cdot \frac{1}{\frac{\color{blue}{\sqrt{\left|\sqrt[3]{z \cdot z - t \cdot a}\right|} \cdot \sqrt{\left|\sqrt[3]{z \cdot z - t \cdot a}\right|}}}{1 \cdot y}}\right) \cdot \frac{z}{\sqrt{\sqrt[3]{z \cdot z - t \cdot a}}}\]
    12. Applied times-frac11.9

      \[\leadsto \left(x \cdot \frac{1}{\color{blue}{\frac{\sqrt{\left|\sqrt[3]{z \cdot z - t \cdot a}\right|}}{1} \cdot \frac{\sqrt{\left|\sqrt[3]{z \cdot z - t \cdot a}\right|}}{y}}}\right) \cdot \frac{z}{\sqrt{\sqrt[3]{z \cdot z - t \cdot a}}}\]
    13. Applied add-cube-cbrt11.9

      \[\leadsto \left(x \cdot \frac{\color{blue}{\left(\sqrt[3]{1} \cdot \sqrt[3]{1}\right) \cdot \sqrt[3]{1}}}{\frac{\sqrt{\left|\sqrt[3]{z \cdot z - t \cdot a}\right|}}{1} \cdot \frac{\sqrt{\left|\sqrt[3]{z \cdot z - t \cdot a}\right|}}{y}}\right) \cdot \frac{z}{\sqrt{\sqrt[3]{z \cdot z - t \cdot a}}}\]
    14. Applied times-frac11.7

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

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

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

    if 3.9023810506562994e+82 < z

    1. Initial program 40.6

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

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

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

Reproduce

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