Average Error: 24.7 → 7.6
Time: 4.2s
Precision: 64
\[\frac{\left(x \cdot y\right) \cdot z}{\sqrt{z \cdot z - t \cdot a}}\]
\[\begin{array}{l} \mathbf{if}\;z \le -329128518468.406921:\\ \;\;\;\;-1 \cdot \left(x \cdot y\right)\\ \mathbf{elif}\;z \le 1.5075919433781039 \cdot 10^{117}:\\ \;\;\;\;\frac{x \cdot \left(y \cdot \frac{z}{\sqrt{\left|\sqrt[3]{z \cdot z - t \cdot a}\right| \cdot \sqrt{\sqrt[3]{z \cdot z - t \cdot a}}}}\right)}{\sqrt{\sqrt{z \cdot z - t \cdot a}}}\\ \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 -329128518468.406921:\\
\;\;\;\;-1 \cdot \left(x \cdot y\right)\\

\mathbf{elif}\;z \le 1.5075919433781039 \cdot 10^{117}:\\
\;\;\;\;\frac{x \cdot \left(y \cdot \frac{z}{\sqrt{\left|\sqrt[3]{z \cdot z - t \cdot a}\right| \cdot \sqrt{\sqrt[3]{z \cdot z - t \cdot a}}}}\right)}{\sqrt{\sqrt{z \cdot z - t \cdot a}}}\\

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

\end{array}
double f(double x, double y, double z, double t, double a) {
        double r304217 = x;
        double r304218 = y;
        double r304219 = r304217 * r304218;
        double r304220 = z;
        double r304221 = r304219 * r304220;
        double r304222 = r304220 * r304220;
        double r304223 = t;
        double r304224 = a;
        double r304225 = r304223 * r304224;
        double r304226 = r304222 - r304225;
        double r304227 = sqrt(r304226);
        double r304228 = r304221 / r304227;
        return r304228;
}

double f(double x, double y, double z, double t, double a) {
        double r304229 = z;
        double r304230 = -329128518468.4069;
        bool r304231 = r304229 <= r304230;
        double r304232 = -1.0;
        double r304233 = x;
        double r304234 = y;
        double r304235 = r304233 * r304234;
        double r304236 = r304232 * r304235;
        double r304237 = 1.507591943378104e+117;
        bool r304238 = r304229 <= r304237;
        double r304239 = r304229 * r304229;
        double r304240 = t;
        double r304241 = a;
        double r304242 = r304240 * r304241;
        double r304243 = r304239 - r304242;
        double r304244 = cbrt(r304243);
        double r304245 = fabs(r304244);
        double r304246 = sqrt(r304244);
        double r304247 = r304245 * r304246;
        double r304248 = sqrt(r304247);
        double r304249 = r304229 / r304248;
        double r304250 = r304234 * r304249;
        double r304251 = r304233 * r304250;
        double r304252 = sqrt(r304243);
        double r304253 = sqrt(r304252);
        double r304254 = r304251 / r304253;
        double r304255 = 1.0;
        double r304256 = r304235 * r304255;
        double r304257 = r304238 ? r304254 : r304256;
        double r304258 = r304231 ? r304236 : r304257;
        return r304258;
}

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.7
Target8.0
Herbie7.6
\[\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 < -329128518468.4069

    1. Initial program 33.3

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

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

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

      \[\leadsto \color{blue}{\frac{x \cdot y}{\sqrt{1}} \cdot \frac{z}{\sqrt{z \cdot z - t \cdot a}}}\]
    6. Simplified30.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-sqr-sqrt30.4

      \[\leadsto \left(x \cdot y\right) \cdot \frac{z}{\sqrt{\color{blue}{\sqrt{z \cdot z - t \cdot a} \cdot \sqrt{z \cdot z - t \cdot a}}}}\]
    9. Applied sqrt-prod30.6

      \[\leadsto \left(x \cdot y\right) \cdot \frac{z}{\color{blue}{\sqrt{\sqrt{z \cdot z - t \cdot a}} \cdot \sqrt{\sqrt{z \cdot z - t \cdot a}}}}\]
    10. Applied *-un-lft-identity30.6

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

      \[\leadsto \left(x \cdot y\right) \cdot \color{blue}{\left(\frac{1}{\sqrt{\sqrt{z \cdot z - t \cdot a}}} \cdot \frac{z}{\sqrt{\sqrt{z \cdot z - t \cdot a}}}\right)}\]
    12. Using strategy rm
    13. Applied associate-*r/30.6

      \[\leadsto \left(x \cdot y\right) \cdot \color{blue}{\frac{\frac{1}{\sqrt{\sqrt{z \cdot z - t \cdot a}}} \cdot z}{\sqrt{\sqrt{z \cdot z - t \cdot a}}}}\]
    14. Applied associate-*r/32.0

      \[\leadsto \color{blue}{\frac{\left(x \cdot y\right) \cdot \left(\frac{1}{\sqrt{\sqrt{z \cdot z - t \cdot a}}} \cdot z\right)}{\sqrt{\sqrt{z \cdot z - t \cdot a}}}}\]
    15. Simplified32.8

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

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

    if -329128518468.4069 < z < 1.507591943378104e+117

    1. Initial program 11.8

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

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

      \[\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-sqr-sqrt10.6

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

      \[\leadsto \left(x \cdot y\right) \cdot \frac{z}{\color{blue}{\sqrt{\sqrt{z \cdot z - t \cdot a}} \cdot \sqrt{\sqrt{z \cdot z - t \cdot a}}}}\]
    10. Applied *-un-lft-identity10.8

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

      \[\leadsto \left(x \cdot y\right) \cdot \color{blue}{\left(\frac{1}{\sqrt{\sqrt{z \cdot z - t \cdot a}}} \cdot \frac{z}{\sqrt{\sqrt{z \cdot z - t \cdot a}}}\right)}\]
    12. Using strategy rm
    13. Applied associate-*r/10.9

      \[\leadsto \left(x \cdot y\right) \cdot \color{blue}{\frac{\frac{1}{\sqrt{\sqrt{z \cdot z - t \cdot a}}} \cdot z}{\sqrt{\sqrt{z \cdot z - t \cdot a}}}}\]
    14. Applied associate-*r/11.2

      \[\leadsto \color{blue}{\frac{\left(x \cdot y\right) \cdot \left(\frac{1}{\sqrt{\sqrt{z \cdot z - t \cdot a}}} \cdot z\right)}{\sqrt{\sqrt{z \cdot z - t \cdot a}}}}\]
    15. Simplified10.9

      \[\leadsto \frac{\color{blue}{x \cdot \left(y \cdot \frac{z}{\sqrt{\sqrt{z \cdot z - t \cdot a}}}\right)}}{\sqrt{\sqrt{z \cdot z - t \cdot a}}}\]
    16. Using strategy rm
    17. Applied add-cube-cbrt11.0

      \[\leadsto \frac{x \cdot \left(y \cdot \frac{z}{\sqrt{\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)}{\sqrt{\sqrt{z \cdot z - t \cdot a}}}\]
    18. Applied sqrt-prod11.0

      \[\leadsto \frac{x \cdot \left(y \cdot \frac{z}{\sqrt{\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)}{\sqrt{\sqrt{z \cdot z - t \cdot a}}}\]
    19. Simplified11.0

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

    if 1.507591943378104e+117 < z

    1. Initial program 46.0

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

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

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

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

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

Reproduce

herbie shell --seed 2020025 
(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)))))