Average Error: 24.9 → 6.9
Time: 4.7s
Precision: 64
\[\frac{\left(x \cdot y\right) \cdot z}{\sqrt{z \cdot z - t \cdot a}}\]
\[\begin{array}{l} \mathbf{if}\;z \le -3.07723386361766317 \cdot 10^{167}:\\ \;\;\;\;x \cdot \left(-1 \cdot y\right)\\ \mathbf{elif}\;z \le -1.4763620082139605 \cdot 10^{-232}:\\ \;\;\;\;\left(x \cdot y\right) \cdot \frac{\frac{1}{\sqrt{z \cdot z - t \cdot a}}}{\frac{1}{z}}\\ \mathbf{elif}\;z \le 1.1968985287902123 \cdot 10^{-192}:\\ \;\;\;\;\frac{x \cdot \left(y \cdot z\right)}{\sqrt{z \cdot z - t \cdot a}}\\ \mathbf{elif}\;z \le 1.39325280236721814 \cdot 10^{110}:\\ \;\;\;\;\left(x \cdot y\right) \cdot \frac{1}{\frac{\sqrt{z \cdot z - t \cdot a}}{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 -3.07723386361766317 \cdot 10^{167}:\\
\;\;\;\;x \cdot \left(-1 \cdot y\right)\\

\mathbf{elif}\;z \le -1.4763620082139605 \cdot 10^{-232}:\\
\;\;\;\;\left(x \cdot y\right) \cdot \frac{\frac{1}{\sqrt{z \cdot z - t \cdot a}}}{\frac{1}{z}}\\

\mathbf{elif}\;z \le 1.1968985287902123 \cdot 10^{-192}:\\
\;\;\;\;\frac{x \cdot \left(y \cdot z\right)}{\sqrt{z \cdot z - t \cdot a}}\\

\mathbf{elif}\;z \le 1.39325280236721814 \cdot 10^{110}:\\
\;\;\;\;\left(x \cdot y\right) \cdot \frac{1}{\frac{\sqrt{z \cdot z - t \cdot a}}{z}}\\

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

\end{array}
double f(double x, double y, double z, double t, double a) {
        double r291026 = x;
        double r291027 = y;
        double r291028 = r291026 * r291027;
        double r291029 = z;
        double r291030 = r291028 * r291029;
        double r291031 = r291029 * r291029;
        double r291032 = t;
        double r291033 = a;
        double r291034 = r291032 * r291033;
        double r291035 = r291031 - r291034;
        double r291036 = sqrt(r291035);
        double r291037 = r291030 / r291036;
        return r291037;
}

double f(double x, double y, double z, double t, double a) {
        double r291038 = z;
        double r291039 = -3.077233863617663e+167;
        bool r291040 = r291038 <= r291039;
        double r291041 = x;
        double r291042 = -1.0;
        double r291043 = y;
        double r291044 = r291042 * r291043;
        double r291045 = r291041 * r291044;
        double r291046 = -1.4763620082139605e-232;
        bool r291047 = r291038 <= r291046;
        double r291048 = r291041 * r291043;
        double r291049 = 1.0;
        double r291050 = r291038 * r291038;
        double r291051 = t;
        double r291052 = a;
        double r291053 = r291051 * r291052;
        double r291054 = r291050 - r291053;
        double r291055 = sqrt(r291054);
        double r291056 = r291049 / r291055;
        double r291057 = r291049 / r291038;
        double r291058 = r291056 / r291057;
        double r291059 = r291048 * r291058;
        double r291060 = 1.1968985287902123e-192;
        bool r291061 = r291038 <= r291060;
        double r291062 = r291043 * r291038;
        double r291063 = r291041 * r291062;
        double r291064 = r291063 / r291055;
        double r291065 = 1.3932528023672181e+110;
        bool r291066 = r291038 <= r291065;
        double r291067 = r291055 / r291038;
        double r291068 = r291049 / r291067;
        double r291069 = r291048 * r291068;
        double r291070 = r291066 ? r291069 : r291048;
        double r291071 = r291061 ? r291064 : r291070;
        double r291072 = r291047 ? r291059 : r291071;
        double r291073 = r291040 ? r291045 : r291072;
        return r291073;
}

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.9
Target7.6
Herbie6.9
\[\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 5 regimes
  2. if z < -3.077233863617663e+167

    1. Initial program 53.5

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

      \[\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-prod53.5

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

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

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

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

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

    if -3.077233863617663e+167 < z < -1.4763620082139605e-232

    1. Initial program 12.9

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

      \[\leadsto \color{blue}{\frac{x \cdot y}{\sqrt{1}} \cdot \frac{z}{\sqrt{z \cdot z - t \cdot a}}}\]
    6. Simplified9.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 clear-num9.3

      \[\leadsto \left(x \cdot y\right) \cdot \color{blue}{\frac{1}{\frac{\sqrt{z \cdot z - t \cdot a}}{z}}}\]
    9. Using strategy rm
    10. Applied div-inv9.4

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

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

    if -1.4763620082139605e-232 < z < 1.1968985287902123e-192

    1. Initial program 18.6

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

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

    if 1.1968985287902123e-192 < z < 1.3932528023672181e+110

    1. Initial program 8.8

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

      \[\leadsto \color{blue}{\frac{x \cdot y}{\sqrt{1}} \cdot \frac{z}{\sqrt{z \cdot z - t \cdot a}}}\]
    6. Simplified6.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 clear-num6.2

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

    if 1.3932528023672181e+110 < z

    1. Initial program 44.8

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \le -3.07723386361766317 \cdot 10^{167}:\\ \;\;\;\;x \cdot \left(-1 \cdot y\right)\\ \mathbf{elif}\;z \le -1.4763620082139605 \cdot 10^{-232}:\\ \;\;\;\;\left(x \cdot y\right) \cdot \frac{\frac{1}{\sqrt{z \cdot z - t \cdot a}}}{\frac{1}{z}}\\ \mathbf{elif}\;z \le 1.1968985287902123 \cdot 10^{-192}:\\ \;\;\;\;\frac{x \cdot \left(y \cdot z\right)}{\sqrt{z \cdot z - t \cdot a}}\\ \mathbf{elif}\;z \le 1.39325280236721814 \cdot 10^{110}:\\ \;\;\;\;\left(x \cdot y\right) \cdot \frac{1}{\frac{\sqrt{z \cdot z - t \cdot a}}{z}}\\ \mathbf{else}:\\ \;\;\;\;x \cdot y\\ \end{array}\]

Reproduce

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