Average Error: 25.5 → 5.3
Time: 4.8s
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.57340581174290523 \cdot 10^{140}:\\ \;\;\;\;-1 \cdot \left(x \cdot y\right)\\ \mathbf{elif}\;z \le 1.0315608467704857 \cdot 10^{107}:\\ \;\;\;\;\frac{x}{\frac{\sqrt[3]{\sqrt{z \cdot z - t \cdot a}} \cdot \sqrt[3]{\sqrt{z \cdot z - t \cdot a}}}{\sqrt[3]{z} \cdot \sqrt[3]{z}}} \cdot \frac{y}{\frac{\sqrt[3]{\sqrt{z \cdot z - t \cdot a}}}{\sqrt[3]{z}}}\\ \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.57340581174290523 \cdot 10^{140}:\\
\;\;\;\;-1 \cdot \left(x \cdot y\right)\\

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

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

\end{array}
double f(double x, double y, double z, double t, double a) {
        double r285053 = x;
        double r285054 = y;
        double r285055 = r285053 * r285054;
        double r285056 = z;
        double r285057 = r285055 * r285056;
        double r285058 = r285056 * r285056;
        double r285059 = t;
        double r285060 = a;
        double r285061 = r285059 * r285060;
        double r285062 = r285058 - r285061;
        double r285063 = sqrt(r285062);
        double r285064 = r285057 / r285063;
        return r285064;
}

double f(double x, double y, double z, double t, double a) {
        double r285065 = z;
        double r285066 = -1.5734058117429052e+140;
        bool r285067 = r285065 <= r285066;
        double r285068 = -1.0;
        double r285069 = x;
        double r285070 = y;
        double r285071 = r285069 * r285070;
        double r285072 = r285068 * r285071;
        double r285073 = 1.0315608467704857e+107;
        bool r285074 = r285065 <= r285073;
        double r285075 = r285065 * r285065;
        double r285076 = t;
        double r285077 = a;
        double r285078 = r285076 * r285077;
        double r285079 = r285075 - r285078;
        double r285080 = sqrt(r285079);
        double r285081 = cbrt(r285080);
        double r285082 = r285081 * r285081;
        double r285083 = cbrt(r285065);
        double r285084 = r285083 * r285083;
        double r285085 = r285082 / r285084;
        double r285086 = r285069 / r285085;
        double r285087 = r285081 / r285083;
        double r285088 = r285070 / r285087;
        double r285089 = r285086 * r285088;
        double r285090 = r285074 ? r285089 : r285071;
        double r285091 = r285067 ? r285072 : r285090;
        return r285091;
}

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

Original25.5
Target7.6
Herbie5.3
\[\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.5734058117429052e+140

    1. Initial program 50.9

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

      \[\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-prod50.9

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

      \[\leadsto \color{blue}{\frac{x \cdot y}{\sqrt{1}} \cdot \frac{z}{\sqrt{z \cdot z - t \cdot a}}}\]
    6. Simplified49.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 div-inv49.6

      \[\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 1.7

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

    if -1.5734058117429052e+140 < z < 1.0315608467704857e+107

    1. Initial program 11.3

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

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

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

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

      \[\leadsto \frac{x \cdot y}{\color{blue}{\frac{\sqrt[3]{\sqrt{z \cdot z - t \cdot a}} \cdot \sqrt[3]{\sqrt{z \cdot z - t \cdot a}}}{\sqrt[3]{z} \cdot \sqrt[3]{z}} \cdot \frac{\sqrt[3]{\sqrt{z \cdot z - t \cdot a}}}{\sqrt[3]{z}}}}\]
    8. Applied times-frac7.4

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

    if 1.0315608467704857e+107 < z

    1. Initial program 45.6

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

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

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

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

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

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

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

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

Reproduce

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