Average Error: 24.3 → 5.9
Time: 18.3s
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.600257058432804334868295655130597155484 \cdot 10^{108}:\\ \;\;\;\;-x \cdot y\\ \mathbf{elif}\;z \le 2.112792157625963034500419357066115959074 \cdot 10^{83}:\\ \;\;\;\;\frac{1}{\frac{\sqrt{\left|\sqrt[3]{z \cdot z - t \cdot a}\right|}}{\sqrt[3]{y} \cdot \sqrt[3]{y}}} \cdot \left(\frac{x}{\frac{\sqrt{\left|\sqrt[3]{z \cdot z - t \cdot a}\right|}}{\sqrt[3]{y}}} \cdot \frac{z}{\sqrt{\sqrt[3]{z \cdot z - t \cdot a}}}\right)\\ \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.600257058432804334868295655130597155484 \cdot 10^{108}:\\
\;\;\;\;-x \cdot y\\

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

\mathbf{else}:\\
\;\;\;\;x \cdot y\\

\end{array}
double f(double x, double y, double z, double t, double a) {
        double r227055 = x;
        double r227056 = y;
        double r227057 = r227055 * r227056;
        double r227058 = z;
        double r227059 = r227057 * r227058;
        double r227060 = r227058 * r227058;
        double r227061 = t;
        double r227062 = a;
        double r227063 = r227061 * r227062;
        double r227064 = r227060 - r227063;
        double r227065 = sqrt(r227064);
        double r227066 = r227059 / r227065;
        return r227066;
}

double f(double x, double y, double z, double t, double a) {
        double r227067 = z;
        double r227068 = -1.6002570584328043e+108;
        bool r227069 = r227067 <= r227068;
        double r227070 = x;
        double r227071 = y;
        double r227072 = r227070 * r227071;
        double r227073 = -r227072;
        double r227074 = 2.112792157625963e+83;
        bool r227075 = r227067 <= r227074;
        double r227076 = 1.0;
        double r227077 = r227067 * r227067;
        double r227078 = t;
        double r227079 = a;
        double r227080 = r227078 * r227079;
        double r227081 = r227077 - r227080;
        double r227082 = cbrt(r227081);
        double r227083 = fabs(r227082);
        double r227084 = sqrt(r227083);
        double r227085 = cbrt(r227071);
        double r227086 = r227085 * r227085;
        double r227087 = r227084 / r227086;
        double r227088 = r227076 / r227087;
        double r227089 = r227084 / r227085;
        double r227090 = r227070 / r227089;
        double r227091 = sqrt(r227082);
        double r227092 = r227067 / r227091;
        double r227093 = r227090 * r227092;
        double r227094 = r227088 * r227093;
        double r227095 = r227075 ? r227094 : r227072;
        double r227096 = r227069 ? r227073 : r227095;
        return r227096;
}

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.3
Target7.4
Herbie5.9
\[\begin{array}{l} \mathbf{if}\;z \lt -3.192130590385276419686361646843883646209 \cdot 10^{46}:\\ \;\;\;\;-y \cdot x\\ \mathbf{elif}\;z \lt 5.976268120920894210257945708950453212935 \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.6002570584328043e+108

    1. Initial program 46.3

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

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

      \[\leadsto \color{blue}{\left(x \cdot y\right)} \cdot \frac{z}{\sqrt{z \cdot z - t \cdot a}}\]
    7. Using strategy rm
    8. Applied div-inv44.2

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

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

    if -1.6002570584328043e+108 < z < 2.112792157625963e+83

    1. Initial program 10.4

      \[\frac{\left(x \cdot y\right) \cdot z}{\sqrt{z \cdot z - t \cdot a}}\]
    2. Using strategy rm
    3. Applied add-cube-cbrt10.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-prod10.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-frac10.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. Simplified10.7

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

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

      \[\leadsto \frac{x}{\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|}}}{\left(\sqrt[3]{y} \cdot \sqrt[3]{y}\right) \cdot \sqrt[3]{y}}} \cdot \frac{z}{\sqrt{\sqrt[3]{z \cdot z - t \cdot a}}}\]
    10. Applied times-frac11.1

      \[\leadsto \frac{x}{\color{blue}{\frac{\sqrt{\left|\sqrt[3]{z \cdot z - t \cdot a}\right|}}{\sqrt[3]{y} \cdot \sqrt[3]{y}} \cdot \frac{\sqrt{\left|\sqrt[3]{z \cdot z - t \cdot a}\right|}}{\sqrt[3]{y}}}} \cdot \frac{z}{\sqrt{\sqrt[3]{z \cdot z - t \cdot a}}}\]
    11. Applied *-un-lft-identity11.1

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

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

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

    if 2.112792157625963e+83 < z

    1. Initial program 40.7

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

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

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

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

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

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

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

Reproduce

herbie shell --seed 2019303 
(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.1921305903852764e46) (- (* y x)) (if (< z 5.9762681209208942e90) (/ (* x z) (/ (sqrt (- (* z z) (* a t))) y)) (* y x)))

  (/ (* (* x y) z) (sqrt (- (* z z) (* t a)))))